diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 63e11ae368..d18d1a4479 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -32,9 +32,6 @@ Run an embedded python interpreter. 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 ' '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 @@ -117,11 +114,6 @@ def main(args=sys.argv): prints('CALIBRE_RESOURCES_PATH='+sys.resources_location) prints('CALIBRE_EXTENSIONS_PATH='+sys.extensions_location) 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: from calibre import ipython ipython() diff --git a/src/calibre/devices/cybook/driver.py b/src/calibre/devices/cybook/driver.py index 5ac0d4999c..8790cea6b8 100644 --- a/src/calibre/devices/cybook/driver.py +++ b/src/calibre/devices/cybook/driver.py @@ -34,6 +34,7 @@ class CYBOOK(USBMS): VENDOR_NAME = 'BOOKEEN' WINDOWS_MAIN_MEM = re.compile(r'CYBOOK_(OPUS|GEN3)__-FD') 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_CARD_A = 'eBooks' diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index f01133c301..fd7cf262dc 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -71,6 +71,11 @@ class Device(DeviceConfig, DevicePlugin): OSX_CARD_A_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 = '' STORAGE_CARD_VOLUME_LABEL = '' STORAGE_CARD2_VOLUME_LABEL = None @@ -415,6 +420,16 @@ class Device(DeviceConfig, DevicePlugin): if len(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 def osx_bsd_names(self):