mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Support for the SONY Reader Touch Edition
This commit is contained in:
parent
841ccff5d2
commit
669d6e313e
@ -365,7 +365,7 @@ from calibre.devices.jetbook.driver import JETBOOK
|
||||
from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX
|
||||
from calibre.devices.prs500.driver import PRS500
|
||||
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
|
||||
|
||||
plugins = [HTML2ZIP]
|
||||
@ -414,7 +414,6 @@ plugins += [
|
||||
PRS500,
|
||||
PRS505,
|
||||
PRS700,
|
||||
PRS600,
|
||||
ANDROID,
|
||||
CYBOOK_OPUS,
|
||||
COOL_ER
|
||||
|
@ -17,6 +17,7 @@ from calibre.devices.usbms.driver import USBMS
|
||||
class KINDLE(USBMS):
|
||||
|
||||
name = 'Kindle Device Interface'
|
||||
gui_name = 'Amazon Kindle'
|
||||
description = _('Communicate with the Kindle eBook reader.')
|
||||
author = _('John Schember')
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
|
@ -112,6 +112,10 @@ class PRS500(DeviceConfig, DevicePlugin):
|
||||
SUPPORTS_SUB_DIRS = False
|
||||
MUST_READ_METADATA = True
|
||||
|
||||
@classmethod
|
||||
def get_gui_name(cls):
|
||||
return 'PRS-500'
|
||||
|
||||
def log_packet(self, packet, header, stream=sys.stderr):
|
||||
"""
|
||||
Log C{packet} to stream C{stream}.
|
||||
|
@ -22,6 +22,7 @@ from calibre import __appname__
|
||||
class PRS505(CLI, Device):
|
||||
|
||||
name = 'PRS-505 Device Interface'
|
||||
gui_name = 'SONY Pocket Edition'
|
||||
description = _('Communicate with the Sony PRS-505 eBook reader.')
|
||||
author = _('Kovid Goyal and John Schember')
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
@ -30,16 +31,16 @@ class PRS505(CLI, Device):
|
||||
|
||||
VENDOR_ID = [0x054c] #: SONY Vendor Id
|
||||
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'
|
||||
WINDOWS_MAIN_MEM = 'PRS-505'
|
||||
WINDOWS_CARD_A_MEM = re.compile(r'PRS-505/\S+:MS')
|
||||
WINDOWS_CARD_B_MEM = re.compile(r'PRS-505/\S+:SD')
|
||||
WINDOWS_MAIN_MEM = re.compile('PRS-(505|300)')
|
||||
WINDOWS_CARD_A_MEM = re.compile(r'PRS-(505|300)/\S+:MS')
|
||||
WINDOWS_CARD_B_MEM = re.compile(r'PRS-(505|300)/\S+:SD')
|
||||
|
||||
OSX_MAIN_MEM = re.compile(r'Sony PRS-505/[^:]+ Media')
|
||||
OSX_CARD_A_MEM = re.compile(r'Sony PRS-505/[^:]+:MS Media')
|
||||
OSX_CARD_B_MEM = re.compile(r'Sony PRS-505/[^:]+:SD Media')
|
||||
OSX_MAIN_MEM = re.compile(r'Sony PRS-(505|300)/[^:]+ Media')
|
||||
OSX_CARD_A_MEM = re.compile(r'Sony PRS-(505|300)/[^:]+:MS Media')
|
||||
OSX_CARD_B_MEM = re.compile(r'Sony PRS-(505|300)/[^:]+:SD Media')
|
||||
|
||||
MAIN_MEMORY_VOLUME_LABEL = 'Sony Reader Main Memory'
|
||||
STORAGE_CARD_VOLUME_LABEL = 'Sony Reader Storage Card'
|
||||
@ -84,7 +85,6 @@ class PRS505(CLI, Device):
|
||||
self._card_b_prefix = None
|
||||
|
||||
def get_device_information(self, end_session=True):
|
||||
#self.report_progress(1.0, _('Get device information...'))
|
||||
return (self.__class__.__name__, '', '', '')
|
||||
|
||||
def books(self, oncard=None, end_session=True):
|
||||
|
@ -16,24 +16,17 @@ class PRS700(PRS505):
|
||||
name = 'PRS-700 Device Interface'
|
||||
description = _('Communicate with the Sony PRS-700 eBook reader.')
|
||||
author = _('Kovid Goyal and John Schember')
|
||||
gui_name = 'SONY Touch edition'
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
|
||||
BCD = [0x31a]
|
||||
|
||||
WINDOWS_MAIN_MEM = 'PRS-700'
|
||||
WINDOWS_CARD_A_MEM = re.compile(r'PRS-700/\S+:MS')
|
||||
WINDOWS_CARD_B_MEM = re.compile(r'PRS-700/\S+:SD')
|
||||
WINDOWS_MAIN_MEM = re.compile('PRS-[67]00')
|
||||
WINDOWS_CARD_A_MEM = re.compile(r'PRS-[67]00/\S+:MS')
|
||||
WINDOWS_CARD_B_MEM = re.compile(r'PRS-[67]00/\S+:SD')
|
||||
|
||||
OSX_MAIN_MEM = re.compile(r'Sony PRS-700/[^:]+ Media')
|
||||
OSX_CARD_A_MEM = re.compile(r'Sony PRS-700/[^:]+:MS Media')
|
||||
OSX_CARD_B_MEM = re.compile(r'Sony PRS-700/[^:]+:SD Media')
|
||||
OSX_MAIN_MEM = re.compile(r'Sony PRS-[67]00/[^:]+ Media')
|
||||
OSX_CARD_A_MEM = re.compile(r'Sony PRS-[67]00/[^:]+:MS 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')
|
||||
|
||||
|
@ -111,6 +111,14 @@ class Device(DeviceConfig, DevicePlugin):
|
||||
def reset(self, key='-1', log_packets=False, report_progress=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
|
||||
def get_fdi(cls):
|
||||
fdi = ''
|
||||
|
@ -722,7 +722,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
self.set_default_thumbnail(\
|
||||
self.device_manager.device.THUMBNAIL_HEIGHT)
|
||||
self.status_bar.showMessage(_('Device: ')+\
|
||||
self.device_manager.device.__class__.__name__+\
|
||||
self.device_manager.device.__class__.get_gui_name()+\
|
||||
_(' detected.'), 3000)
|
||||
self.device_connected = True
|
||||
self._sync_menu.enable_device_actions(True, self.device_manager.device.card_prefix())
|
||||
|
@ -90,7 +90,7 @@ class Sony500(Device):
|
||||
class Sony505(Sony500):
|
||||
|
||||
output_format = 'EPUB'
|
||||
name = 'SONY PRS 505/700'
|
||||
name = 'SONY Reader Pocket/Touch Edition'
|
||||
id = 'prs505'
|
||||
|
||||
class CybookG3(Device):
|
||||
|
10
upload.py
10
upload.py
@ -633,7 +633,7 @@ class build_windows(VMInstaller):
|
||||
|
||||
class build_osx(VMInstaller):
|
||||
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):
|
||||
return (self.BUILD_SCRIPT%subs).replace('rm ', 'sudo rm ')
|
||||
@ -642,15 +642,13 @@ class build_osx(VMInstaller):
|
||||
installer = installer_name('dmg')
|
||||
python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python'
|
||||
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'))
|
||||
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):
|
||||
raise Exception('Failed to build installer '+installer)
|
||||
if not self.dont_shutdown:
|
||||
Popen(('ssh', 'osx_build', 'sudo', '/sbin/shutdown', '-h', 'now'))
|
||||
time.sleep(20)
|
||||
self.stop_vmware()
|
||||
Popen(('ssh', 'tiger_build', 'sudo', '/sbin/shutdown', '-h', 'now'))
|
||||
return os.path.basename(installer)
|
||||
|
||||
class upload_installers(OptionlessCommand):
|
||||
|
Loading…
x
Reference in New Issue
Block a user