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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import os
  5. from calibre.devices.usbms.driver import USBMS, BookList
  6.  
  7. class FOLDER_DEVICE_FOR_CONFIG(USBMS):
  8.     name = 'Folder Device Interface'
  9.     gui_name = 'Folder Device'
  10.     description = _('Use an arbitrary folder as a device.')
  11.     author = 'John Schember/Charles Haley'
  12.     supported_platforms = [
  13.         'windows',
  14.         'osx',
  15.         'linux']
  16.     FORMATS = [
  17.         'epub',
  18.         'fb2',
  19.         'mobi',
  20.         'azw',
  21.         'lrf',
  22.         'tcr',
  23.         'pmlz',
  24.         'lit',
  25.         'rtf',
  26.         'rb',
  27.         'pdf',
  28.         'oeb',
  29.         'txt',
  30.         'pdb',
  31.         'prc']
  32.     VENDOR_ID = 65535
  33.     PRODUCT_ID = 65535
  34.     BCD = 65535
  35.     DEVICE_PLUGBOARD_NAME = 'FOLDER_DEVICE'
  36.  
  37.  
  38. class FOLDER_DEVICE(USBMS):
  39.     type = _('Device Interface')
  40.     name = 'Folder Device Interface'
  41.     gui_name = 'Folder Device'
  42.     description = _('Use an arbitrary folder as a device.')
  43.     author = 'John Schember/Charles Haley'
  44.     supported_platforms = [
  45.         'windows',
  46.         'osx',
  47.         'linux']
  48.     FORMATS = FOLDER_DEVICE_FOR_CONFIG.FORMATS
  49.     VENDOR_ID = 65535
  50.     PRODUCT_ID = 65535
  51.     BCD = 65535
  52.     DEVICE_PLUGBOARD_NAME = 'FOLDER_DEVICE'
  53.     THUMBNAIL_HEIGHT = 68
  54.     CAN_SET_METADATA = [
  55.         'title',
  56.         'authors']
  57.     SUPPORTS_SUB_DIRS = True
  58.     icon = I('devices/folder.png')
  59.     METADATA_CACHE = '.metadata.calibre'
  60.     _main_prefix = ''
  61.     _card_a_prefix = None
  62.     _card_b_prefix = None
  63.     is_connected = False
  64.     
  65.     def __init__(self, path):
  66.         if not os.path.isdir(path):
  67.             raise IOError, 'Path is not a folder'
  68.         os.path.isdir(path)
  69.         path = USBMS.normalize_path(path)
  70.         if path.endswith(os.sep):
  71.             self._main_prefix = path
  72.         else:
  73.             self._main_prefix = path + os.sep
  74.         self.booklist_class = BookList
  75.         self.is_connected = True
  76.  
  77.     
  78.     def reset(self, key = '-1', log_packets = False, report_progress = None, detected_device = None):
  79.         pass
  80.  
  81.     
  82.     def unmount_device(self):
  83.         self._main_prefix = ''
  84.         self.is_connected = False
  85.  
  86.     
  87.     def is_usb_connected(self, devices_on_system, debug = False, only_presence = False):
  88.         return (self.is_connected, self)
  89.  
  90.     
  91.     def open(self):
  92.         if not self._main_prefix:
  93.             return False
  94.         return True
  95.  
  96.     
  97.     def set_progress_reporter(self, report_progress):
  98.         self.report_progress = report_progress
  99.  
  100.     
  101.     def card_prefix(self, end_session = True):
  102.         return (None, None)
  103.  
  104.     
  105.     def eject(self):
  106.         self.is_connected = False
  107.  
  108.     
  109.     def settings(self):
  110.         return FOLDER_DEVICE_FOR_CONFIG._config().parse()
  111.  
  112.     settings = classmethod(settings)
  113.  
  114.