Fix bug: 1755, add new Vendor and Product Ids for Cybook.

This commit is contained in:
John Schember 2009-02-09 17:34:51 -05:00
parent 373d224738
commit 358ec20ceb
3 changed files with 25 additions and 22 deletions

View File

@ -17,8 +17,8 @@ class CYBOOKG3(USBMS):
# Be sure these have an entry in calibre.devices.mime # Be sure these have an entry in calibre.devices.mime
FORMATS = ['mobi', 'prc', 'html', 'pdf', 'rtf', 'txt'] FORMATS = ['mobi', 'prc', 'html', 'pdf', 'rtf', 'txt']
VENDOR_ID = 0x0bda VENDOR_ID = [0x0bda, 0x3034]
PRODUCT_ID = 0x0703 PRODUCT_ID = [0x0703, 0x1795]
BCD = [0x110, 0x132] BCD = [0x110, 0x132]
VENDOR_NAME = 'BOOKEEN' VENDOR_NAME = 'BOOKEEN'

View File

@ -12,8 +12,8 @@ class KINDLE(USBMS):
# Ordered list of supported formats # Ordered list of supported formats
FORMATS = ['azw', 'mobi', 'prc', 'txt'] FORMATS = ['azw', 'mobi', 'prc', 'txt']
VENDOR_ID = 0x1949 VENDOR_ID = [0x1949]
PRODUCT_ID = 0x0001 PRODUCT_ID = [0x0001]
BCD = [0x399] BCD = [0x399]
VENDOR_NAME = 'KINDLE' VENDOR_NAME = 'KINDLE'

View File

@ -74,18 +74,21 @@ class Device(_Device):
def get_fdi(cls): def get_fdi(cls):
fdi = '' fdi = ''
for vid in cls.VENDOR_ID:
for pid in cls.PRODUCT_ID:
fdi_base_values = dict( fdi_base_values = dict(
app=__appname__, app=__appname__,
deviceclass=cls.__name__, deviceclass=cls.__name__,
vendor_id=hex(cls.VENDOR_ID), vendor_id=hex(vid),
product_id=hex(cls.PRODUCT_ID), product_id=hex(pid),
main_memory=cls.MAIN_MEMORY_VOLUME_LABEL, main_memory=cls.MAIN_MEMORY_VOLUME_LABEL,
storage_card=cls.STORAGE_CARD_VOLUME_LABEL, storage_card=cls.STORAGE_CARD_VOLUME_LABEL,
) )
if cls.BCD is None: if cls.BCD is None:
fdi_base_values['BCD_start'] = '' fdi_base_values['BCD_start'] = ''
fdi_base_values['BCD_end'] = '' fdi_base_values['BCD_end'] = ''
fdi = cls.FDI_TEMPLATE % fdi_base_values fdi += cls.FDI_TEMPLATE % fdi_base_values
else: else:
for bcd in cls.BCD: for bcd in cls.BCD:
fdi_bcd_values = fdi_base_values fdi_bcd_values = fdi_base_values