home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_747 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  5.1 KB  |  185 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2009, Tijmen Ruizendaal <tijmen at mybebook.com>'
  6. __docformat__ = 'restructuredtext en'
  7. import re
  8. from calibre.devices.usbms.driver import USBMS
  9.  
  10. class HANLINV3(USBMS):
  11.     name = 'Hanlin V3 driver'
  12.     gui_name = 'Hanlin V3'
  13.     description = _('Communicate with Hanlin V3 eBook readers.')
  14.     author = 'Tijmen Ruizendaal'
  15.     supported_platforms = [
  16.         'windows',
  17.         'osx',
  18.         'linux']
  19.     FORMATS = [
  20.         'epub',
  21.         'mobi',
  22.         'fb2',
  23.         'lit',
  24.         'prc',
  25.         'pdf',
  26.         'rtf',
  27.         'txt']
  28.     VENDOR_ID = [
  29.         1317]
  30.     PRODUCT_ID = [
  31.         34819,
  32.         26627]
  33.     BCD = [
  34.         786]
  35.     VENDOR_NAME = 'LINUX'
  36.     WINDOWS_MAIN_MEM = 'FILE-STOR_GADGET'
  37.     WINDOWS_CARD_A_MEM = 'FILE-STOR_GADGET'
  38.     OSX_MAIN_MEM = 'Linux File-Stor Gadget Media'
  39.     OSX_CARD_A_MEM = 'Linux File-Stor Gadget Media'
  40.     MAIN_MEMORY_VOLUME_LABEL = 'Hanlin V3 Internal Memory'
  41.     STORAGE_CARD_VOLUME_LABEL = 'Hanlin V3 Storage Card'
  42.     SUPPORTS_SUB_DIRS = True
  43.     
  44.     def osx_sort_names(self, names):
  45.         main = names.get('main', None)
  46.         card = names.get('carda', None)
  47.         
  48.         try:
  49.             main_num = None if main else None
  50.         except:
  51.             main_num = None
  52.  
  53.         
  54.         try:
  55.             card_num = None if card else None
  56.         except:
  57.             card_num = None
  58.  
  59.         if card_num is not None and main_num is not None and card_num > main_num:
  60.             names['main'] = card
  61.             names['carda'] = main
  62.         
  63.         if card and not main:
  64.             names['main'] = card
  65.             names['carda'] = None
  66.         
  67.         return names
  68.  
  69.     
  70.     def linux_swap_drives(self, drives):
  71.         if len(drives) < 2:
  72.             return drives
  73.         drives = list(drives)
  74.         t = drives[0]
  75.         drives[0] = drives[1]
  76.         drives[1] = t
  77.         return tuple(drives)
  78.  
  79.     
  80.     def windows_sort_drives(self, drives):
  81.         if len(drives) < 2:
  82.             return drives
  83.         main = drives.get('main', None)
  84.         carda = drives.get('carda', None)
  85.         if main and carda:
  86.             drives['main'] = carda
  87.             drives['carda'] = main
  88.         
  89.         return drives
  90.  
  91.  
  92.  
  93. class SPECTRA(HANLINV3):
  94.     name = 'Spectra'
  95.     gui_name = 'Spectra'
  96.     PRODUCT_ID = [
  97.         42149]
  98.     FORMATS = [
  99.         'epub',
  100.         'mobi',
  101.         'fb2',
  102.         'lit',
  103.         'prc',
  104.         'chm',
  105.         'djvu',
  106.         'pdf',
  107.         'rtf',
  108.         'txt']
  109.     SUPPORTS_SUB_DIRS = True
  110.  
  111.  
  112. class HANLINV5(HANLINV3):
  113.     name = 'Hanlin V5 driver'
  114.     gui_name = 'Hanlin V5'
  115.     description = _('Communicate with Hanlin V5 eBook readers.')
  116.     VENDOR_ID = [
  117.         1170]
  118.     PRODUCT_ID = [
  119.         34835]
  120.     BCD = [
  121.         793]
  122.     OSX_MAIN_MEM = 'Hanlin V5 Internal Memory'
  123.     OSX_CARD_MEM = 'Hanlin V5 Storage Card'
  124.     MAIN_MEMORY_VOLUME_LABEL = 'Hanlin V5 Internal Memory'
  125.     STORAGE_CARD_VOLUME_LABEL = 'Hanlin V5 Storage Card'
  126.     OSX_EJECT_COMMAND = [
  127.         'diskutil',
  128.         'unmount',
  129.         'force']
  130.  
  131.  
  132. class BOOX(HANLINV3):
  133.     name = 'BOOX driver'
  134.     gui_name = 'BOOX'
  135.     description = _('Communicate with the BOOX eBook reader.')
  136.     author = 'Jesus Manuel Marinho Valcarce'
  137.     supported_platforms = [
  138.         'windows',
  139.         'osx',
  140.         'linux']
  141.     METADATA_CACHE = '.metadata.calibre'
  142.     FORMATS = [
  143.         'epub',
  144.         'fb2',
  145.         'djvu',
  146.         'pdf',
  147.         'html',
  148.         'txt',
  149.         'rtf',
  150.         'mobi',
  151.         'prc',
  152.         'chm',
  153.         'doc']
  154.     VENDOR_ID = [
  155.         1317]
  156.     PRODUCT_ID = [
  157.         42149]
  158.     BCD = [
  159.         802]
  160.     MAIN_MEMORY_VOLUME_LABEL = 'BOOX Internal Memory'
  161.     STORAGE_CARD_VOLUME_LABEL = 'BOOX Storage Card'
  162.     EBOOK_DIR_MAIN = [
  163.         'MyBooks']
  164.     EXTRA_CUSTOMIZATION_MESSAGE = _('Comma separated list of directories to send e-books to on the device. The first one that exists will be used.')
  165.     EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
  166.     
  167.     def post_open_callback(self):
  168.         opts = self.settings()
  169.         dirs = opts.extra_customization
  170.         self.EBOOK_DIR_MAIN = dirs
  171.  
  172.     
  173.     def windows_sort_drives(self, drives):
  174.         return drives
  175.  
  176.     
  177.     def osx_sort_names(self, names):
  178.         return names
  179.  
  180.     
  181.     def linux_swap_drives(self, drives):
  182.         return drives
  183.  
  184.  
  185.