home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_752 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  3.9 KB  |  121 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.         'lrf',
  21.         'tcr',
  22.         'pmlz',
  23.         'lit',
  24.         'rtf',
  25.         'rb',
  26.         'pdf',
  27.         'oeb',
  28.         'txt',
  29.         'pdb']
  30.     VENDOR_ID = 65535
  31.     PRODUCT_ID = 65535
  32.     BCD = 65535
  33.  
  34.  
  35. class FOLDER_DEVICE(USBMS):
  36.     type = _('Device Interface')
  37.     name = 'Folder Device Interface'
  38.     gui_name = 'Folder Device'
  39.     description = _('Use an arbitrary folder as a device.')
  40.     author = 'John Schember/Charles Haley'
  41.     supported_platforms = [
  42.         'windows',
  43.         'osx',
  44.         'linux']
  45.     FORMATS = [
  46.         'epub',
  47.         'fb2',
  48.         'mobi',
  49.         'lrf',
  50.         'tcr',
  51.         'pmlz',
  52.         'lit',
  53.         'rtf',
  54.         'rb',
  55.         'pdf',
  56.         'oeb',
  57.         'txt',
  58.         'pdb']
  59.     VENDOR_ID = 65535
  60.     PRODUCT_ID = 65535
  61.     BCD = 65535
  62.     THUMBNAIL_HEIGHT = 68
  63.     CAN_SET_METADATA = True
  64.     SUPPORTS_SUB_DIRS = True
  65.     icon = I('devices/folder.svg')
  66.     METADATA_CACHE = '.metadata.calibre'
  67.     _main_prefix = ''
  68.     _card_a_prefix = None
  69.     _card_b_prefix = None
  70.     is_connected = False
  71.     
  72.     def __init__(self, path):
  73.         if not os.path.isdir(path):
  74.             raise IOError, 'Path is not a folder'
  75.         os.path.isdir(path)
  76.         path = USBMS.normalize_path(path)
  77.         if path.endswith(os.sep):
  78.             self._main_prefix = path
  79.         else:
  80.             self._main_prefix = path + os.sep
  81.         self.booklist_class = BookList
  82.         self.is_connected = True
  83.  
  84.     
  85.     def reset(self, key = '-1', log_packets = False, report_progress = None, detected_device = None):
  86.         pass
  87.  
  88.     
  89.     def unmount_device(self):
  90.         self._main_prefix = ''
  91.         self.is_connected = False
  92.  
  93.     
  94.     def is_usb_connected(self, devices_on_system, debug = False, only_presence = False):
  95.         return (self.is_connected, self)
  96.  
  97.     
  98.     def open(self):
  99.         if not self._main_prefix:
  100.             return False
  101.         return True
  102.  
  103.     
  104.     def set_progress_reporter(self, report_progress):
  105.         self.report_progress = report_progress
  106.  
  107.     
  108.     def card_prefix(self, end_session = True):
  109.         return (None, None)
  110.  
  111.     
  112.     def eject(self):
  113.         self.is_connected = False
  114.  
  115.     
  116.     def settings(self):
  117.         return FOLDER_DEVICE_FOR_CONFIG._config().parse()
  118.  
  119.     settings = classmethod(settings)
  120.  
  121.