From 4ea4faf204f657f6111b60830de90ae56de5e50b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 24 Feb 2009 10:29:03 -0800 Subject: [PATCH] Initial support for the Kindle 2 --- src/calibre/devices/__init__.py | 3 ++- src/calibre/devices/kindle/driver.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/calibre/devices/__init__.py b/src/calibre/devices/__init__.py index ebb95a4e86..ed16dba14b 100644 --- a/src/calibre/devices/__init__.py +++ b/src/calibre/devices/__init__.py @@ -11,7 +11,8 @@ def devices(): from calibre.devices.prs700.driver import PRS700 from calibre.devices.cybookg3.driver import CYBOOKG3 from calibre.devices.kindle.driver import KINDLE - return (PRS500, PRS505, PRS700, CYBOOKG3, KINDLE) + from calibre.devices.kindle.driver import KINDLE2 + return (PRS500, PRS505, PRS700, CYBOOKG3, KINDLE, KINDLE2) import time diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py index f9f87028ae..e35d5f8cd3 100755 --- a/src/calibre/devices/kindle/driver.py +++ b/src/calibre/devices/kindle/driver.py @@ -4,7 +4,7 @@ __copyright__ = '2009, John Schember ' Device driver for Amazon's Kindle ''' -import os, fnmatch +import os from calibre.devices.usbms.driver import USBMS @@ -35,10 +35,13 @@ class KINDLE(USBMS): if os.path.exists(path): os.unlink(path) - filepath, ext = os.path.splitext(path) - basepath, filename = os.path.split(filepath) + filepath = os.path.splitext(path)[0] # Delete the ebook auxiliary file if os.path.exists(filepath + '.mbp'): os.unlink(filepath + '.mbp') +class KINDLE2(KINDLE): + + PRODUCT_ID = [0x0002] + BCD = [0x0100] \ No newline at end of file