Thread: Library names
View Single Post
Old 02-28-2011, 06:25 AM   #26
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,481
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Taking into account theduck's suggestions, I now have device_info containing:
Code:
{'info': [
      'Folder Device', '', '', '', 
      {'main': 
        {'device_store_uuid': '586a8563-679d-45cf-8c82-fd6100143fd8', 
         'calibre_version': u'0.7.47', 
         'prefix': u'C:/Users/charles/Desktop/debug/', 
         'last_library_uuid': 'THIS IS A UUID', 
         'date_last_connected': u'2011-02-28 13:13:00.776000+00:00'
        }
      }
    ], 
  'prefixes': (None, None), 
  'freespace': (321195761664L, 0, 0)}
The record is a dict of three elements: 'info', 'prefixes', and 'freespace'.

The first 4 elements of the 'info' list are the device type name, device version, software version on device, and mime type. In most cases the 2nd through 4th are not known and are set to ''. The fifth element in the list is the driveinfo dict containing up to three keys: 'main', 'A', and 'B', providing information about the memory in the device. The key and associated data will be there only if the device has the memory location installed. If the device does not support driveinfo, then the dict will be contain no keys.

device_store_uuid will be set the first time that calibre sees a device or a card. last_library_uuid will be UUID of the library open in calibre when the device was last connected (once we have it)

The 'prefixes' list contains two elements: the path to memory cards A and B if the memory is installed, otherwise None.

The 'drivespace' list contains three elements: the amount of free space on main memory, card A, and card B.

The API for fetching the information is device_manager.get_current_device_information().

Last edited by chaley; 02-28-2011 at 08:37 AM.
chaley is offline   Reply With Quote