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,24 +74,27 @@ class Device(_Device):
def get_fdi(cls): def get_fdi(cls):
fdi = '' fdi = ''
fdi_base_values = dict( for vid in cls.VENDOR_ID:
app=__appname__, for pid in cls.PRODUCT_ID:
deviceclass=cls.__name__, fdi_base_values = dict(
vendor_id=hex(cls.VENDOR_ID), app=__appname__,
product_id=hex(cls.PRODUCT_ID), deviceclass=cls.__name__,
main_memory=cls.MAIN_MEMORY_VOLUME_LABEL, vendor_id=hex(vid),
storage_card=cls.STORAGE_CARD_VOLUME_LABEL, product_id=hex(pid),
) main_memory=cls.MAIN_MEMORY_VOLUME_LABEL,
if cls.BCD is None: storage_card=cls.STORAGE_CARD_VOLUME_LABEL,
fdi_base_values['BCD_start'] = '' )
fdi_base_values['BCD_end'] = ''
fdi = cls.FDI_TEMPLATE % fdi_base_values if cls.BCD is None:
else: fdi_base_values['BCD_start'] = ''
for bcd in cls.BCD: fdi_base_values['BCD_end'] = ''
fdi_bcd_values = fdi_base_values fdi += cls.FDI_TEMPLATE % fdi_base_values
fdi_bcd_values['BCD_start'] = cls.FDI_BCD_TEMPLATE % dict(bcd=hex(bcd)) else:
fdi_bcd_values['BCD_end'] = '</match>' for bcd in cls.BCD:
fdi += cls.FDI_TEMPLATE % fdi_bcd_values fdi_bcd_values = fdi_base_values
fdi_bcd_values['BCD_start'] = cls.FDI_BCD_TEMPLATE % dict(bcd=hex(bcd))
fdi_bcd_values['BCD_end'] = '</match>'
fdi += cls.FDI_TEMPLATE % fdi_bcd_values
return fdi return fdi