home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_755 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  4.8 KB  |  166 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 HANLINV5(HANLINV3):
  94.     name = 'Hanlin V5 driver'
  95.     gui_name = 'Hanlin V5'
  96.     description = _('Communicate with Hanlin V5 eBook readers.')
  97.     VENDOR_ID = [
  98.         1170]
  99.     PRODUCT_ID = [
  100.         34835]
  101.     BCD = [
  102.         793]
  103.     OSX_MAIN_MEM = 'Hanlin V5 Internal Memory'
  104.     OSX_CARD_MEM = 'Hanlin V5 Storage Card'
  105.     MAIN_MEMORY_VOLUME_LABEL = 'Hanlin V5 Internal Memory'
  106.     STORAGE_CARD_VOLUME_LABEL = 'Hanlin V5 Storage Card'
  107.     OSX_EJECT_COMMAND = [
  108.         'diskutil',
  109.         'unmount',
  110.         'force']
  111.  
  112.  
  113. class BOOX(HANLINV3):
  114.     name = 'BOOX driver'
  115.     gui_name = 'BOOX'
  116.     description = _('Communicate with the BOOX eBook reader.')
  117.     author = 'Jesus Manuel Marinho Valcarce'
  118.     supported_platforms = [
  119.         'windows',
  120.         'osx',
  121.         'linux']
  122.     METADATA_CACHE = '.metadata.calibre'
  123.     FORMATS = [
  124.         'epub',
  125.         'fb2',
  126.         'djvu',
  127.         'pdf',
  128.         'html',
  129.         'txt',
  130.         'rtf',
  131.         'mobi',
  132.         'prc',
  133.         'chm',
  134.         'doc']
  135.     VENDOR_ID = [
  136.         1317]
  137.     PRODUCT_ID = [
  138.         42149]
  139.     BCD = [
  140.         802]
  141.     MAIN_MEMORY_VOLUME_LABEL = 'BOOX Internal Memory'
  142.     STORAGE_CARD_VOLUME_LABEL = 'BOOX Storage Card'
  143.     EBOOK_DIR_MAIN = [
  144.         'MyBooks']
  145.     EXTRA_CUSTOMIZATION_MESSAGE = _('Comma separated list of directories to send e-books to on the device. The first one that exists will be used.')
  146.     EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
  147.     
  148.     def post_open_callback(self):
  149.         opts = self.settings()
  150.         dirs = opts.extra_customization
  151.         self.EBOOK_DIR_MAIN = dirs
  152.  
  153.     
  154.     def windows_sort_drives(self, drives):
  155.         return drives
  156.  
  157.     
  158.     def osx_sort_names(self, names):
  159.         return names
  160.  
  161.     
  162.     def linux_swap_drives(self, drives):
  163.         return drives
  164.  
  165.  
  166.