mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use a single driver for the Nook and Nook color
This commit is contained in:
parent
612ea061c4
commit
983cf1e52f
@ -594,7 +594,7 @@ from calibre.devices.iliad.driver import ILIAD
|
|||||||
from calibre.devices.irexdr.driver import IREXDR1000, IREXDR800
|
from calibre.devices.irexdr.driver import IREXDR1000, IREXDR800
|
||||||
from calibre.devices.jetbook.driver import JETBOOK, MIBUK, JETBOOK_MINI
|
from calibre.devices.jetbook.driver import JETBOOK, MIBUK, JETBOOK_MINI
|
||||||
from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX
|
from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX
|
||||||
from calibre.devices.nook.driver import NOOK, NOOK_COLOR, NOOK_TSR
|
from calibre.devices.nook.driver import NOOK, NOOK_COLOR
|
||||||
from calibre.devices.prs505.driver import PRS505
|
from calibre.devices.prs505.driver import PRS505
|
||||||
from calibre.devices.user_defined.driver import USER_DEFINED
|
from calibre.devices.user_defined.driver import USER_DEFINED
|
||||||
from calibre.devices.android.driver import ANDROID, S60
|
from calibre.devices.android.driver import ANDROID, S60
|
||||||
@ -694,7 +694,7 @@ plugins += [
|
|||||||
KINDLE,
|
KINDLE,
|
||||||
KINDLE2,
|
KINDLE2,
|
||||||
KINDLE_DX,
|
KINDLE_DX,
|
||||||
NOOK, NOOK_COLOR, NOOK_TSR,
|
NOOK, NOOK_COLOR,
|
||||||
PRS505,
|
PRS505,
|
||||||
ANDROID,
|
ANDROID,
|
||||||
S60,
|
S60,
|
||||||
|
@ -81,13 +81,12 @@ class NOOK(USBMS):
|
|||||||
return [x.replace('#', '_') for x in components]
|
return [x.replace('#', '_') for x in components]
|
||||||
|
|
||||||
class NOOK_COLOR(NOOK):
|
class NOOK_COLOR(NOOK):
|
||||||
gui_name = _('Nook Color')
|
description = _('Communicate with the Nook Color and TSR eBook readers.')
|
||||||
description = _('Communicate with the Nook Color eBook reader.')
|
|
||||||
|
|
||||||
PRODUCT_ID = [0x002]
|
PRODUCT_ID = [0x002, 0x003]
|
||||||
BCD = [0x216]
|
BCD = [0x216]
|
||||||
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'EBOOK_DISK'
|
|
||||||
|
|
||||||
|
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'EBOOK_DISK'
|
||||||
EBOOK_DIR_MAIN = 'My Files'
|
EBOOK_DIR_MAIN = 'My Files'
|
||||||
|
|
||||||
def upload_cover(self, path, filename, metadata, filepath):
|
def upload_cover(self, path, filename, metadata, filepath):
|
||||||
@ -102,31 +101,7 @@ class NOOK_COLOR(NOOK):
|
|||||||
is_news = mdata.tags and _('News') in mdata.tags
|
is_news = mdata.tags and _('News') in mdata.tags
|
||||||
subdir = 'Magazines' if is_news else 'Books'
|
subdir = 'Magazines' if is_news else 'Books'
|
||||||
path = os.path.join(path, subdir)
|
path = os.path.join(path, subdir)
|
||||||
return NOOK.create_upload_path(self, path, mdata, fname,
|
return USBMS.create_upload_path(self, path, mdata, fname,
|
||||||
create_dirs=create_dirs)
|
create_dirs=create_dirs)
|
||||||
|
|
||||||
class NOOK_TSR(NOOK):
|
|
||||||
gui_name = _('Nook Simple')
|
|
||||||
description = _('Communicate with the Nook TSR eBook reader.')
|
|
||||||
|
|
||||||
PRODUCT_ID = [0x003]
|
|
||||||
BCD = [0x216]
|
|
||||||
|
|
||||||
EBOOK_DIR_MAIN = 'My Files'
|
|
||||||
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'EBOOK_DISK'
|
|
||||||
|
|
||||||
def upload_cover(self, path, filename, metadata, filepath):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def get_carda_ebook_dir(self, for_upload=False):
|
|
||||||
if for_upload:
|
|
||||||
return self.EBOOK_DIR_MAIN
|
|
||||||
return ''
|
|
||||||
|
|
||||||
def create_upload_path(self, path, mdata, fname, create_dirs=True):
|
|
||||||
is_news = mdata.tags and _('News') in mdata.tags
|
|
||||||
subdir = 'Newspapers' if is_news else 'Books'
|
|
||||||
path = os.path.join(path, subdir)
|
|
||||||
return NOOK.create_upload_path(self, path, mdata, fname,
|
|
||||||
create_dirs=create_dirs)
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user