mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PRS 700 support
This commit is contained in:
parent
5b08d46a1f
commit
470faaecc0
@ -138,7 +138,7 @@ ProjectID
|
||||
DA98A0C6-9102-73EC-2516-B147E972D3F7
|
||||
|
||||
ProjectVersion
|
||||
1.2.10.1
|
||||
1.2.7.0
|
||||
|
||||
SaveOnlyToplevelDirs
|
||||
No
|
||||
@ -1100,9 +1100,6 @@ AAFE58A0-2DFB-CA20-1F6E-D3815F885996,Alias
|
||||
AIX-ppc,Active
|
||||
No
|
||||
|
||||
AIX-ppc,BuildSeparateArchives
|
||||
No
|
||||
|
||||
AIX-ppc,DefaultDirectoryPermission
|
||||
0755
|
||||
|
||||
@ -1478,9 +1475,6 @@ FBA33088-C809-DD6B-D337-EADBF1CEE966,String
|
||||
FreeBSD-4-x86,Active
|
||||
No
|
||||
|
||||
FreeBSD-4-x86,BuildSeparateArchives
|
||||
No
|
||||
|
||||
FreeBSD-4-x86,DefaultDirectoryPermission
|
||||
0755
|
||||
|
||||
@ -1532,9 +1526,6 @@ FreeBSD-4-x86,RootInstallDir
|
||||
FreeBSD-x86,Active
|
||||
No
|
||||
|
||||
FreeBSD-x86,BuildSeparateArchives
|
||||
No
|
||||
|
||||
FreeBSD-x86,DefaultDirectoryPermission
|
||||
0755
|
||||
|
||||
@ -1586,9 +1577,6 @@ FreeBSD-x86,RootInstallDir
|
||||
HPUX-hppa,Active
|
||||
No
|
||||
|
||||
HPUX-hppa,BuildSeparateArchives
|
||||
No
|
||||
|
||||
HPUX-hppa,DefaultDirectoryPermission
|
||||
0755
|
||||
|
||||
@ -1640,9 +1628,6 @@ HPUX-hppa,RootInstallDir
|
||||
Linux-x86,Active
|
||||
No
|
||||
|
||||
Linux-x86,BuildSeparateArchives
|
||||
No
|
||||
|
||||
Linux-x86,DefaultDirectoryPermission
|
||||
0755
|
||||
|
||||
@ -1694,9 +1679,6 @@ Linux-x86,RootInstallDir
|
||||
Solaris-sparc,Active
|
||||
No
|
||||
|
||||
Solaris-sparc,BuildSeparateArchives
|
||||
No
|
||||
|
||||
Solaris-sparc,DefaultDirectoryPermission
|
||||
0755
|
||||
|
||||
@ -1748,9 +1730,6 @@ Solaris-sparc,RootInstallDir
|
||||
TarArchive,Active
|
||||
No
|
||||
|
||||
TarArchive,BuildSeparateArchives
|
||||
No
|
||||
|
||||
TarArchive,CompressionLevel
|
||||
6
|
||||
|
||||
@ -1811,15 +1790,9 @@ TarArchive,VirtualTextMap
|
||||
Windows,Active
|
||||
Yes
|
||||
|
||||
Windows,BuildSeparateArchives
|
||||
No
|
||||
|
||||
Windows,Executable
|
||||
<%AppName%>-<%Version%><%Ext%>
|
||||
|
||||
Windows,FileDescription
|
||||
{<%AppName%> <%Version%> Setup}
|
||||
|
||||
Windows,IncludeTWAPI
|
||||
Yes
|
||||
|
||||
@ -1856,9 +1829,6 @@ Windows,WindowsIcon
|
||||
ZipArchive,Active
|
||||
No
|
||||
|
||||
ZipArchive,BuildSeparateArchives
|
||||
No
|
||||
|
||||
ZipArchive,CompressionLevel
|
||||
6
|
||||
|
||||
@ -1951,7 +1921,7 @@ E611105F-DC85-9E20-4F7B-E63C54E5DF06,Message
|
||||
3EA07B17-04D8-6508-B535-96CC7173B49A,Message
|
||||
{<%AppName%> version <%Version%> created by Kovid Goyal
|
||||
|
||||
Please ensure that calibre is not running, as this will cause the installation to fail. Click Next to continue or Cancel to exit Setup.}
|
||||
Please make sure that calibre is not running, as this will cause the install to fail. Click Next to continue or Cancel to exit Setup.}
|
||||
|
||||
442920D9-8A51-9476-14E4-787D5C230E84,Message
|
||||
<%UninstallCompleteText%>
|
||||
|
@ -7,8 +7,9 @@ Device drivers.
|
||||
def devices():
|
||||
from calibre.devices.prs500.driver import PRS500
|
||||
from calibre.devices.prs505.driver import PRS505
|
||||
from calibre.devices.kindle.driver import KINDLE
|
||||
return (PRS500, PRS505, KINDLE)
|
||||
from calibre.devices.prs700.driver import PRS700
|
||||
#from calibre.devices.kindle.driver import KINDLE
|
||||
return (PRS500, PRS505, PRS700)
|
||||
|
||||
import time
|
||||
|
||||
|
@ -20,6 +20,7 @@ class Device(object):
|
||||
FORMATS = ["lrf", "rtf", "pdf", "txt"]
|
||||
VENDOR_ID = 0x0000
|
||||
PRODUCT_ID = 0x0000
|
||||
BCD = 0x0000
|
||||
THUMBNAIL_HEIGHT = 68 # Height for thumbnails on device
|
||||
|
||||
def __init__(self, key='-1', log_packets=False, report_progress=None) :
|
||||
|
@ -355,6 +355,6 @@ def get_devices():
|
||||
for bus in buslist:
|
||||
devices = bus.device_list
|
||||
for dev in devices:
|
||||
device = (dev.device_descriptor.idVendor, dev.device_descriptor.idProduct)
|
||||
device = (dev.device_descriptor.idVendor, dev.device_descriptor.idProduct, dev.device_descriptor.bcdDevice)
|
||||
ans.append(device)
|
||||
return ans
|
@ -85,6 +85,7 @@ class PRS500(Device):
|
||||
|
||||
VENDOR_ID = 0x054c #: SONY Vendor Id
|
||||
PRODUCT_ID = 0x029b #: Product Id for the PRS-500
|
||||
BCD = 0x100
|
||||
PRODUCT_NAME = 'PRS-500'
|
||||
VENDOR_NAME = 'SONY'
|
||||
INTERFACE_ID = 0 #: The interface we use to talk to the device
|
||||
|
@ -29,6 +29,7 @@ class File(object):
|
||||
class PRS505(Device):
|
||||
VENDOR_ID = 0x054c #: SONY Vendor Id
|
||||
PRODUCT_ID = 0x031e #: Product Id for the PRS-505
|
||||
BCD = 0x229 #: Needed to disambiguate 505 and 700 on linux
|
||||
PRODUCT_NAME = 'PRS-505'
|
||||
VENDOR_NAME = 'SONY'
|
||||
FORMATS = ['lrf', 'epub', "rtf", "pdf", "txt"]
|
||||
@ -49,9 +50,11 @@ class PRS505(Device):
|
||||
<match key="info.category" string="volume">
|
||||
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="%(vendor_id)s">
|
||||
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="%(product_id)s">
|
||||
<match key="volume.is_partition" bool="false">
|
||||
<merge key="volume.label" type="string">%(main_memory)s</merge>
|
||||
<merge key="%(app)s.mainvolume" type="string">%(deviceclass)s</merge>
|
||||
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.device_revision_bcd" int="%(bcd)s">
|
||||
<match key="volume.is_partition" bool="false">
|
||||
<merge key="volume.label" type="string">%(main_memory)s</merge>
|
||||
<merge key="%(app)s.mainvolume" type="string">%(deviceclass)s</merge>
|
||||
</match>
|
||||
</match>
|
||||
</match>
|
||||
</match>
|
||||
@ -81,6 +84,7 @@ class PRS505(Device):
|
||||
deviceclass=cls.__name__,
|
||||
vendor_id=hex(cls.VENDOR_ID),
|
||||
product_id=hex(cls.PRODUCT_ID),
|
||||
bcd=hex(cls.BCD),
|
||||
main_memory=cls.MAIN_MEMORY_VOLUME_LABEL,
|
||||
storage_card=cls.STORAGE_CARD_VOLUME_LABEL,
|
||||
)
|
||||
@ -281,7 +285,7 @@ class PRS505(Device):
|
||||
self.report_progress = pr
|
||||
|
||||
def get_device_information(self, end_session=True):
|
||||
return ('PRS-505', '', '', '')
|
||||
return (self.__class__.__name__, '', '', '')
|
||||
|
||||
def card_prefix(self, end_session=True):
|
||||
return self._card_prefix
|
||||
|
6
src/calibre/devices/prs700/__init__.py
Normal file
6
src/calibre/devices/prs700/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
'''
|
||||
Device driver for the SONY PRS-700
|
||||
'''
|
||||
|
15
src/calibre/devices/prs700/driver.py
Normal file
15
src/calibre/devices/prs700/driver.py
Normal file
@ -0,0 +1,15 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
'''
|
||||
Device driver for the SONY PRS-700
|
||||
'''
|
||||
|
||||
from calibre.devices.prs505.driver import PRS505
|
||||
|
||||
class PRS700(PRS505):
|
||||
|
||||
BCD = 0x31a
|
||||
PRODUCT_NAME = 'PRS-700'
|
||||
OSX_NAME = 'Sony PRS-700'
|
||||
|
@ -47,9 +47,10 @@ class DeviceScanner(object):
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
for vendor, product in self.devices:
|
||||
for vendor, product, bcdDevice in self.devices:
|
||||
if device.VENDOR_ID == vendor and device.PRODUCT_ID == product:
|
||||
return True
|
||||
if hasattr(device, 'BCD') and device.BCD == bcdDevice:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
@ -57,7 +57,7 @@ usbobserver_get_usb_devices(PyObject *self, PyObject *args) {
|
||||
IOCFPlugInInterface **plugInInterface = NULL;
|
||||
SInt32 score;
|
||||
IOUSBDeviceInterface182 **dev = NULL;
|
||||
UInt16 vendor, product;
|
||||
UInt16 vendor, product, bcd;
|
||||
|
||||
PyObject *devices, *device;
|
||||
devices = PyList_New(0);
|
||||
@ -80,7 +80,8 @@ usbobserver_get_usb_devices(PyObject *self, PyObject *args) {
|
||||
|
||||
kr = (*dev)->GetDeviceVendor(dev, &vendor);
|
||||
kr = (*dev)->GetDeviceProduct(dev, &product);
|
||||
device = Py_BuildValue("(ii)", vendor, product);
|
||||
kr = (*dev)->GetDeviceReleaseNumber(dev, &bcd);
|
||||
device = Py_BuildValue("(iii)", vendor, product, bcd);
|
||||
if (device == NULL) {
|
||||
IOObjectRelease(usbDevice);
|
||||
(*plugInInterface)->Release(plugInInterface);
|
||||
|
@ -338,12 +338,14 @@ def setup_udev_rules(group_file, reload, fatal_errors):
|
||||
<device>
|
||||
<match key="usb_device.vendor_id" int="%(vendor_id)s">
|
||||
<match key="usb_device.product_id" int="%(product_id)s">
|
||||
<merge key="calibre.deviceclass" type="string">%(cls)s</merge>
|
||||
<match key="usb_device.device_revision_bcd" int="%(bcd)s">
|
||||
<merge key="calibre.deviceclass" type="string">%(cls)s</merge>
|
||||
</match>
|
||||
</match>
|
||||
</match>
|
||||
</device>
|
||||
'''%dict(cls=cls.__name__, vendor_id=cls.VENDOR_ID, product_id=cls.PRODUCT_ID,
|
||||
prog=__appname__))
|
||||
prog=__appname__, bcd=cls.BCD))
|
||||
fdi.write('\n'+cls.get_fdi())
|
||||
fdi.write('\n</deviceinfo>\n')
|
||||
fdi.close()
|
||||
|
@ -12,7 +12,7 @@ from lxml import html
|
||||
|
||||
class NYTimesMobile(BasicNewsRecipe):
|
||||
|
||||
title = 'The New York Times (mobile)'
|
||||
title = 'The New York Times'
|
||||
__author__ = 'Kovid Goyal'
|
||||
description = 'Daily news from the New York Times (mobile version)'
|
||||
timefmt = ' [%a, %d %b, %Y]'
|
||||
|
Loading…
x
Reference in New Issue
Block a user