home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_726 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  3.5 KB  |  151 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
  6. __docformat__ = 'restructuredtext en'
  7. from calibre.devices.usbms.driver import USBMS
  8.  
  9. class ANDROID(USBMS):
  10.     name = 'Android driver'
  11.     gui_name = 'Android phone'
  12.     description = _('Communicate with Android phones.')
  13.     author = 'Kovid Goyal'
  14.     supported_platforms = [
  15.         'windows',
  16.         'osx',
  17.         'linux']
  18.     FORMATS = [
  19.         'epub',
  20.         'pdf']
  21.     VENDOR_ID = {
  22.         2996: {
  23.             3074: [
  24.                 256,
  25.                 551],
  26.             3073: [
  27.                 256,
  28.                 551],
  29.             4089: [
  30.                 256,
  31.                 551] },
  32.         8888: {
  33.             16857: [
  34.                 534],
  35.             11623: [
  36.                 256],
  37.             16859: [
  38.                 534],
  39.             17029: [
  40.                 534] },
  41.         4046: {
  42.             53550: [
  43.                 256] },
  44.         6353: {
  45.             19985: [
  46.                 256,
  47.                 550],
  48.             19986: [
  49.                 256,
  50.                 550] },
  51.         1256: {
  52.             26653: [
  53.                 546,
  54.                 1024],
  55.             26652: [
  56.                 546,
  57.                 548,
  58.                 1024] },
  59.         1282: {
  60.             12803: [
  61.                 256] },
  62.         16700: {
  63.             45063: [
  64.                 256] },
  65.         1037: {
  66.             2129: [
  67.                 1] } }
  68.     EBOOK_DIR_MAIN = [
  69.         'wordplayer/calibretransfer',
  70.         'eBooks/import',
  71.         'Books']
  72.     EXTRA_CUSTOMIZATION_MESSAGE = _('Comma separated list of directories to send e-books to on the device. The first one that exists will be used')
  73.     EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
  74.     VENDOR_NAME = [
  75.         'HTC',
  76.         'MOTOROLA',
  77.         'GOOGLE_',
  78.         'ANDROID',
  79.         'ACER',
  80.         'GT-I5700',
  81.         'SAMSUNG',
  82.         'DELL',
  83.         'LINUX']
  84.     WINDOWS_MAIN_MEM = [
  85.         'ANDROID_PHONE',
  86.         'A855',
  87.         'A853',
  88.         'INC.NEXUS_ONE',
  89.         '__UMS_COMPOSITE',
  90.         '_MB200',
  91.         'MASS_STORAGE',
  92.         '_-_CARD',
  93.         'GT-I9000',
  94.         'FILE-STOR_GADGET',
  95.         'SGH-T959']
  96.     WINDOWS_CARD_A_MEM = [
  97.         'ANDROID_PHONE',
  98.         'GT-I9000_CARD',
  99.         'FILE-STOR_GADGET',
  100.         'SGH-T959']
  101.     OSX_MAIN_MEM = 'HTC Android Phone Media'
  102.     MAIN_MEMORY_VOLUME_LABEL = 'Android Phone Internal Memory'
  103.     SUPPORTS_SUB_DIRS = True
  104.     
  105.     def post_open_callback(self):
  106.         opts = self.settings()
  107.         dirs = opts.extra_customization
  108.         self.EBOOK_DIR_MAIN = dirs
  109.  
  110.     
  111.     def get_main_ebook_dir(self, for_upload = False):
  112.         dirs = self.EBOOK_DIR_MAIN
  113.         if not for_upload:
  114.             
  115.             def aldiko_tweak(x):
  116.                 if x == 'eBooks/import':
  117.                     return 'eBooks'
  118.                 return x
  119.  
  120.             if isinstance(dirs, basestring):
  121.                 dirs = [
  122.                     dirs]
  123.             
  124.             dirs = list(map(aldiko_tweak, dirs))
  125.         
  126.         return dirs
  127.  
  128.  
  129.  
  130. class S60(USBMS):
  131.     name = 'S60 driver'
  132.     gui_name = 'S60 phone'
  133.     description = _('Communicate with S60 phones.')
  134.     author = 'Kovid Goyal'
  135.     supported_platforms = [
  136.         'windows',
  137.         'osx',
  138.         'linux']
  139.     VENDOR_ID = [
  140.         1057]
  141.     PRODUCT_ID = [
  142.         342]
  143.     BCD = [
  144.         256]
  145.     FORMATS = [
  146.         'fb2']
  147.     EBOOK_DIR_MAIN = 'FB2 Books'
  148.     VENDOR_NAME = 'NOKIA'
  149.     WINDOWS_MAIN_MEM = 'S60'
  150.  
  151.