mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #4521 (Cybook Gen3 Firmware 2 Mac OSX 10.4)
This commit is contained in:
parent
b4cff43ee2
commit
94ce2cf8da
@ -32,9 +32,6 @@ Run an embedded python interpreter.
|
|||||||
help='Add a simple plugin (i.e. a plugin that consists of only a '
|
help='Add a simple plugin (i.e. a plugin that consists of only a '
|
||||||
'.py file), by specifying the path to the py file containing the '
|
'.py file), by specifying the path to the py file containing the '
|
||||||
'plugin code.')
|
'plugin code.')
|
||||||
parser.add_option('--pdfreflow', default=None,
|
|
||||||
help='Path to PDF file to try and reflow. Output will be placed in '
|
|
||||||
'current directory. ')
|
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
@ -117,11 +114,6 @@ def main(args=sys.argv):
|
|||||||
prints('CALIBRE_RESOURCES_PATH='+sys.resources_location)
|
prints('CALIBRE_RESOURCES_PATH='+sys.resources_location)
|
||||||
prints('CALIBRE_EXTENSIONS_PATH='+sys.extensions_location)
|
prints('CALIBRE_EXTENSIONS_PATH='+sys.extensions_location)
|
||||||
prints('CALIBRE_PYTHON_PATH='+os.pathsep.join(sys.path))
|
prints('CALIBRE_PYTHON_PATH='+os.pathsep.join(sys.path))
|
||||||
elif opts.pdfreflow:
|
|
||||||
from calibre.ebooks.pdf.reflow import option_parser as px, run
|
|
||||||
from calibre.utils.logging import default_log
|
|
||||||
opts2, args = px().parse_args(['xxxx', '-vvvv', opts.pdfreflow])
|
|
||||||
run(opts2, opts.pdfreflow, default_log)
|
|
||||||
else:
|
else:
|
||||||
from calibre import ipython
|
from calibre import ipython
|
||||||
ipython()
|
ipython()
|
||||||
|
@ -34,6 +34,7 @@ class CYBOOK(USBMS):
|
|||||||
VENDOR_NAME = 'BOOKEEN'
|
VENDOR_NAME = 'BOOKEEN'
|
||||||
WINDOWS_MAIN_MEM = re.compile(r'CYBOOK_(OPUS|GEN3)__-FD')
|
WINDOWS_MAIN_MEM = re.compile(r'CYBOOK_(OPUS|GEN3)__-FD')
|
||||||
WINDOWS_CARD_A_MEM = re.compile('CYBOOK_(OPUS|GEN3)__-SD')
|
WINDOWS_CARD_A_MEM = re.compile('CYBOOK_(OPUS|GEN3)__-SD')
|
||||||
|
OSX_MAIN_MEM_VOL_PAT = re.compile(r'/Cybook')
|
||||||
|
|
||||||
EBOOK_DIR_MAIN = 'eBooks'
|
EBOOK_DIR_MAIN = 'eBooks'
|
||||||
EBOOK_DIR_CARD_A = 'eBooks'
|
EBOOK_DIR_CARD_A = 'eBooks'
|
||||||
|
@ -71,6 +71,11 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
OSX_CARD_A_MEM = None
|
OSX_CARD_A_MEM = None
|
||||||
OSX_CARD_B_MEM = None
|
OSX_CARD_B_MEM = None
|
||||||
|
|
||||||
|
# Used by the new driver detection to disambiguate main memory from
|
||||||
|
# storage cards. Should be a regular expression that matches the
|
||||||
|
# main memory mount point assigned by OS X
|
||||||
|
OSX_MAIN_MEM_VOL_PAT = None
|
||||||
|
|
||||||
MAIN_MEMORY_VOLUME_LABEL = ''
|
MAIN_MEMORY_VOLUME_LABEL = ''
|
||||||
STORAGE_CARD_VOLUME_LABEL = ''
|
STORAGE_CARD_VOLUME_LABEL = ''
|
||||||
STORAGE_CARD2_VOLUME_LABEL = None
|
STORAGE_CARD2_VOLUME_LABEL = None
|
||||||
@ -415,6 +420,16 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
if len(matches) > 2:
|
if len(matches) > 2:
|
||||||
drives['cardb'] = matches[2]
|
drives['cardb'] = matches[2]
|
||||||
|
|
||||||
|
pat = self.OSX_MAIN_MEM_VOL_PAT
|
||||||
|
if pat is not None and len(drives) > 1 and 'main' in drives:
|
||||||
|
if pat.search(drives['main']) is None:
|
||||||
|
main = drives['main']
|
||||||
|
for x in ('carda', 'cardb'):
|
||||||
|
if x in drives and pat.search(drives[x]):
|
||||||
|
drives['main'] = drives.pop(x)
|
||||||
|
drives[x] = main
|
||||||
|
break
|
||||||
|
|
||||||
return drives
|
return drives
|
||||||
|
|
||||||
def osx_bsd_names(self):
|
def osx_bsd_names(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user