Support for the SONY Reader Touch Edition

This commit is contained in:
Kovid Goyal 2009-08-28 14:22:37 -06:00
parent 841ccff5d2
commit 669d6e313e
9 changed files with 35 additions and 32 deletions

View File

@ -365,7 +365,7 @@ from calibre.devices.jetbook.driver import JETBOOK
from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX
from calibre.devices.prs500.driver import PRS500 from calibre.devices.prs500.driver import PRS500
from calibre.devices.prs505.driver import PRS505 from calibre.devices.prs505.driver import PRS505
from calibre.devices.prs700.driver import PRS700, PRS600 from calibre.devices.prs700.driver import PRS700
from calibre.devices.android.driver import ANDROID from calibre.devices.android.driver import ANDROID
plugins = [HTML2ZIP] plugins = [HTML2ZIP]
@ -414,7 +414,6 @@ plugins += [
PRS500, PRS500,
PRS505, PRS505,
PRS700, PRS700,
PRS600,
ANDROID, ANDROID,
CYBOOK_OPUS, CYBOOK_OPUS,
COOL_ER COOL_ER

View File

@ -17,6 +17,7 @@ from calibre.devices.usbms.driver import USBMS
class KINDLE(USBMS): class KINDLE(USBMS):
name = 'Kindle Device Interface' name = 'Kindle Device Interface'
gui_name = 'Amazon Kindle'
description = _('Communicate with the Kindle eBook reader.') description = _('Communicate with the Kindle eBook reader.')
author = _('John Schember') author = _('John Schember')
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']

View File

@ -112,6 +112,10 @@ class PRS500(DeviceConfig, DevicePlugin):
SUPPORTS_SUB_DIRS = False SUPPORTS_SUB_DIRS = False
MUST_READ_METADATA = True MUST_READ_METADATA = True
@classmethod
def get_gui_name(cls):
return 'PRS-500'
def log_packet(self, packet, header, stream=sys.stderr): def log_packet(self, packet, header, stream=sys.stderr):
""" """
Log C{packet} to stream C{stream}. Log C{packet} to stream C{stream}.

View File

@ -22,6 +22,7 @@ from calibre import __appname__
class PRS505(CLI, Device): class PRS505(CLI, Device):
name = 'PRS-505 Device Interface' name = 'PRS-505 Device Interface'
gui_name = 'SONY Pocket Edition'
description = _('Communicate with the Sony PRS-505 eBook reader.') description = _('Communicate with the Sony PRS-505 eBook reader.')
author = _('Kovid Goyal and John Schember') author = _('Kovid Goyal and John Schember')
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
@ -30,16 +31,16 @@ class PRS505(CLI, Device):
VENDOR_ID = [0x054c] #: SONY Vendor Id VENDOR_ID = [0x054c] #: SONY Vendor Id
PRODUCT_ID = [0x031e] #: Product Id for the PRS-505 PRODUCT_ID = [0x031e] #: Product Id for the PRS-505
BCD = [0x229, 0x1000] #: Needed to disambiguate 505 and 700 on linux BCD = [0x229, 0x1000]
VENDOR_NAME = 'SONY' VENDOR_NAME = 'SONY'
WINDOWS_MAIN_MEM = 'PRS-505' WINDOWS_MAIN_MEM = re.compile('PRS-(505|300)')
WINDOWS_CARD_A_MEM = re.compile(r'PRS-505/\S+:MS') WINDOWS_CARD_A_MEM = re.compile(r'PRS-(505|300)/\S+:MS')
WINDOWS_CARD_B_MEM = re.compile(r'PRS-505/\S+:SD') WINDOWS_CARD_B_MEM = re.compile(r'PRS-(505|300)/\S+:SD')
OSX_MAIN_MEM = re.compile(r'Sony PRS-505/[^:]+ Media') OSX_MAIN_MEM = re.compile(r'Sony PRS-(505|300)/[^:]+ Media')
OSX_CARD_A_MEM = re.compile(r'Sony PRS-505/[^:]+:MS Media') OSX_CARD_A_MEM = re.compile(r'Sony PRS-(505|300)/[^:]+:MS Media')
OSX_CARD_B_MEM = re.compile(r'Sony PRS-505/[^:]+:SD Media') OSX_CARD_B_MEM = re.compile(r'Sony PRS-(505|300)/[^:]+:SD Media')
MAIN_MEMORY_VOLUME_LABEL = 'Sony Reader Main Memory' MAIN_MEMORY_VOLUME_LABEL = 'Sony Reader Main Memory'
STORAGE_CARD_VOLUME_LABEL = 'Sony Reader Storage Card' STORAGE_CARD_VOLUME_LABEL = 'Sony Reader Storage Card'
@ -84,7 +85,6 @@ class PRS505(CLI, Device):
self._card_b_prefix = None self._card_b_prefix = None
def get_device_information(self, end_session=True): def get_device_information(self, end_session=True):
#self.report_progress(1.0, _('Get device information...'))
return (self.__class__.__name__, '', '', '') return (self.__class__.__name__, '', '', '')
def books(self, oncard=None, end_session=True): def books(self, oncard=None, end_session=True):

View File

@ -16,24 +16,17 @@ class PRS700(PRS505):
name = 'PRS-700 Device Interface' name = 'PRS-700 Device Interface'
description = _('Communicate with the Sony PRS-700 eBook reader.') description = _('Communicate with the Sony PRS-700 eBook reader.')
author = _('Kovid Goyal and John Schember') author = _('Kovid Goyal and John Schember')
gui_name = 'SONY Touch edition'
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
BCD = [0x31a] BCD = [0x31a]
WINDOWS_MAIN_MEM = 'PRS-700' WINDOWS_MAIN_MEM = re.compile('PRS-[67]00')
WINDOWS_CARD_A_MEM = re.compile(r'PRS-700/\S+:MS') WINDOWS_CARD_A_MEM = re.compile(r'PRS-[67]00/\S+:MS')
WINDOWS_CARD_B_MEM = re.compile(r'PRS-700/\S+:SD') WINDOWS_CARD_B_MEM = re.compile(r'PRS-[67]00/\S+:SD')
OSX_MAIN_MEM = re.compile(r'Sony PRS-700/[^:]+ Media') OSX_MAIN_MEM = re.compile(r'Sony PRS-[67]00/[^:]+ Media')
OSX_CARD_A_MEM = re.compile(r'Sony PRS-700/[^:]+:MS Media') OSX_CARD_A_MEM = re.compile(r'Sony PRS-[67]00/[^:]+:MS Media')
OSX_CARD_B_MEM = re.compile(r'Sony PRS-700/[^:]+:SD Media') OSX_CARD_B_MEM = re.compile(r'Sony PRS-[67]00/[^:]+:SD Media')
class PRS600(PRS700):
name = 'PRS-600 Device Interface'
description = PRS700.description.replace('700', '600')
WINDOWS_MAIN_MEM = 'PRS-600'
WINDOWS_CARD_A_MEM = re.compile(r'PRS-700/\S+:MS')
WINDOWS_CARD_B_MEM = re.compile(r'PRS-700/\S+:SD')

View File

@ -111,6 +111,14 @@ class Device(DeviceConfig, DevicePlugin):
def reset(self, key='-1', log_packets=False, report_progress=None) : def reset(self, key='-1', log_packets=False, report_progress=None) :
self._main_prefix = self._card_a_prefix = self._card_b_prefix = None self._main_prefix = self._card_a_prefix = self._card_b_prefix = None
@classmethod
def get_gui_name(cls):
x = getattr(cls, 'gui_name', None)
if x is None:
x = cls.__name__
return x
@classmethod @classmethod
def get_fdi(cls): def get_fdi(cls):
fdi = '' fdi = ''

View File

@ -722,7 +722,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self.set_default_thumbnail(\ self.set_default_thumbnail(\
self.device_manager.device.THUMBNAIL_HEIGHT) self.device_manager.device.THUMBNAIL_HEIGHT)
self.status_bar.showMessage(_('Device: ')+\ self.status_bar.showMessage(_('Device: ')+\
self.device_manager.device.__class__.__name__+\ self.device_manager.device.__class__.get_gui_name()+\
_(' detected.'), 3000) _(' detected.'), 3000)
self.device_connected = True self.device_connected = True
self._sync_menu.enable_device_actions(True, self.device_manager.device.card_prefix()) self._sync_menu.enable_device_actions(True, self.device_manager.device.card_prefix())

View File

@ -90,7 +90,7 @@ class Sony500(Device):
class Sony505(Sony500): class Sony505(Sony500):
output_format = 'EPUB' output_format = 'EPUB'
name = 'SONY PRS 505/700' name = 'SONY Reader Pocket/Touch Edition'
id = 'prs505' id = 'prs505'
class CybookG3(Device): class CybookG3(Device):

View File

@ -633,7 +633,7 @@ class build_windows(VMInstaller):
class build_osx(VMInstaller): class build_osx(VMInstaller):
description = 'Build OS X app bundle' description = 'Build OS X app bundle'
VM = '/vmware/calibre_os_x/Mac OSX.vmx' VM = '/vmware/bin/tiger_build'
def get_build_script(self, subs): def get_build_script(self, subs):
return (self.BUILD_SCRIPT%subs).replace('rm ', 'sudo rm ') return (self.BUILD_SCRIPT%subs).replace('rm ', 'sudo rm ')
@ -642,15 +642,13 @@ class build_osx(VMInstaller):
installer = installer_name('dmg') installer = installer_name('dmg')
python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python' python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python'
self.start_vmware() self.start_vmware()
self.start_vm('osx_build', ('sudo %s setup.py develop'%python, python, self.start_vm('tiger_build', ('sudo %s setup.py develop'%python, python,
'installer/osx/freeze.py')) 'installer/osx/freeze.py'))
check_call(('scp', 'osx_build:build/calibre/dist/*.dmg', 'dist')) check_call(('scp', 'tiger_build:build/calibre/dist/*.dmg', 'dist'))
if not os.path.exists(installer): if not os.path.exists(installer):
raise Exception('Failed to build installer '+installer) raise Exception('Failed to build installer '+installer)
if not self.dont_shutdown: if not self.dont_shutdown:
Popen(('ssh', 'osx_build', 'sudo', '/sbin/shutdown', '-h', 'now')) Popen(('ssh', 'tiger_build', 'sudo', '/sbin/shutdown', '-h', 'now'))
time.sleep(20)
self.stop_vmware()
return os.path.basename(installer) return os.path.basename(installer)
class upload_installers(OptionlessCommand): class upload_installers(OptionlessCommand):