re-organize SONY drivers

This commit is contained in:
Kovid Goyal 2009-12-12 19:44:26 -07:00
parent b2e252f805
commit 51e20a8764
5 changed files with 24 additions and 42 deletions

View File

@ -411,8 +411,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.nook.driver import NOOK from calibre.devices.nook.driver import NOOK
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, PRS700
from calibre.devices.prs700.driver import PRS700
from calibre.devices.android.driver import ANDROID from calibre.devices.android.driver import ANDROID
from calibre.devices.eslick.driver import ESLICK from calibre.devices.eslick.driver import ESLICK
from calibre.devices.nuut2.driver import NUUT2 from calibre.devices.nuut2.driver import NUUT2

View File

@ -24,7 +24,7 @@ class PRS505(CLI, Device):
name = 'PRS-300/505 Device Interface' name = 'PRS-300/505 Device Interface'
gui_name = 'SONY Pocket Edition' gui_name = 'SONY Pocket Edition'
description = _('Communicate with the Sony PRS-300/505/500 eBook reader.') description = _('Communicate with the Sony PRS-300/505/500 eBook reader.')
author = _('Kovid Goyal and John Schember') author = 'Kovid Goyal and John Schember'
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
path_sep = '/' path_sep = '/'
@ -202,3 +202,22 @@ class PRS505(CLI, Device):
self.report_progress(1.0, _('Sending metadata to device...')) self.report_progress(1.0, _('Sending metadata to device...'))
class PRS700(PRS505):
name = 'PRS-600/700 Device Interface'
description = _('Communicate with the Sony PRS-600/700 eBook reader.')
author = 'Kovid Goyal and John Schember'
gui_name = 'SONY Touch edition'
supported_platforms = ['windows', 'osx', 'linux']
BCD = [0x31a]
WINDOWS_MAIN_MEM = re.compile('PRS-((700/)|(600&))')
WINDOWS_CARD_A_MEM = re.compile(r'PRS-((700/\S+:)|(600_))MS')
WINDOWS_CARD_B_MEM = re.compile(r'PRS-((700/\S+:)|(600_))SD')
OSX_MAIN_MEM = re.compile(r'Sony PRS-((700/[^:]+)|(600)) Media')
OSX_CARD_A_MEM = re.compile(r'Sony PRS-((700/[^:]+:)|(600 ))MS Media')
OSX_CARD_B_MEM = re.compile(r'Sony PRS-((700/[^:]+:)|(600 ))SD Media')

View File

@ -1,6 +0,0 @@
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
Device driver for the SONY PRS-700
'''

View File

@ -1,32 +0,0 @@
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
Device driver for the SONY PRS-700
'''
from calibre.devices.prs505.driver import PRS505
import re
class PRS700(PRS505):
name = 'PRS-600/700 Device Interface'
description = _('Communicate with the Sony PRS-600/700 eBook reader.')
author = _('Kovid Goyal and John Schember')
gui_name = 'SONY Touch edition'
supported_platforms = ['windows', 'osx', 'linux']
BCD = [0x31a]
WINDOWS_MAIN_MEM = re.compile('PRS-((700/)|(600&))')
WINDOWS_CARD_A_MEM = re.compile(r'PRS-((700/\S+:)|(600_))MS')
WINDOWS_CARD_B_MEM = re.compile(r'PRS-((700/\S+:)|(600_))SD')
OSX_MAIN_MEM = re.compile(r'Sony PRS-((700/[^:]+)|(600)) Media')
OSX_CARD_A_MEM = re.compile(r'Sony PRS-((700/[^:]+:)|(600 ))MS Media')
OSX_CARD_B_MEM = re.compile(r'Sony PRS-((700/[^:]+:)|(600 ))SD Media')

View File

@ -65,8 +65,10 @@ class LinuxScanner(object):
ans.add(tuple(dev)) ans.add(tuple(dev))
return ans return ans
linux_scanner = None
linux_scanner = LinuxScanner() if islinux:
linux_scanner = LinuxScanner()
class DeviceScanner(object): class DeviceScanner(object):