diff --git a/installer/osx/freeze.py b/installer/osx/freeze.py index 2471e2867f..28d2bd9aa2 100644 --- a/installer/osx/freeze.py +++ b/installer/osx/freeze.py @@ -19,7 +19,7 @@ from modulegraph.find_modules import find_modules PYTHON = '/Library/Frameworks/Python.framework/Versions/Current/bin/python' class BuildAPP(py2app): - QT_PREFIX = '/Volumes/sw/qt' + QT_PREFIX = '/Users/kovid/qt' LOADER_TEMPLATE = \ r'''#!/usr/bin/env python import os, sys, glob @@ -230,7 +230,7 @@ _check_symlinks_prescript() all_functions = main_functions['console'] + main_functions['gui'] print print 'Adding PoDoFo' - pdf = glob.glob(os.path.expanduser('~/podofo/*.dylib'))[0] + pdf = glob.glob(os.path.expanduser('/Volumes/sw/podofo/*.dylib'))[0] shutil.copyfile(pdf, os.path.join(frameworks_dir, os.path.basename(pdf))) diff --git a/setup.py b/setup.py index 92ee757fdd..c83a93fa51 100644 --- a/setup.py +++ b/setup.py @@ -62,16 +62,16 @@ if __name__ == '__main__': podofo_inc = '/usr/include/podofo' if islinux else \ 'C:\\podofo\\include\\podofo' if iswindows else \ - '/Users/kovid/podofo/include/podofo' + '/Volumes/sw/podofo/include/podofo' podofo_lib = '/usr/lib' if islinux else r'C:\podofo' if iswindows else \ - '/Users/kovid/podofo/lib' + '/Volumes/sw/podofo/lib' + podofo_inc = os.environ.get('PODOFO_INC_DIR', podofo_inc) if os.path.exists(os.path.join(podofo_inc, 'podofo.h')): optional.append(Extension('calibre.plugins.podofo', sources=['src/calibre/utils/podofo/podofo.cpp'], libraries=['podofo'], library_dirs=[os.environ.get('PODOFO_LIB_DIR', podofo_lib)], - include_dirs=\ - [os.environ.get('PODOFO_INC_DIR', podofo_inc)])) + include_dirs=[podofo_inc])) else: print 'WARNING: PoDoFo not found on your system. Various PDF related', print 'functionality will not work.' diff --git a/src/calibre/devices/interface.py b/src/calibre/devices/interface.py index f4ade8d02e..11011bcadf 100644 --- a/src/calibre/devices/interface.py +++ b/src/calibre/devices/interface.py @@ -79,7 +79,7 @@ class DevicePlugin(Plugin): are pending GUI jobs that need to communicate with the device. ''' raise NotImplementedError() - + def set_progress_reporter(self, report_progress): ''' @param report_progress: Function that is called with a % progress diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 7ad93b1d6e..f0c54d7051 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -493,9 +493,15 @@ class Device(DeviceConfig, DevicePlugin): def eject_windows(self): pass - + def eject_osx(self): - pass + for x in ('_main_prefix', '_card_a_prefix', '_card_b_prefix'): + x = getattr(self, x, None) + if x is not None: + try: + subprocess.Popen(['diskutil', 'eject', x]) + except: + pass def eject_linux(self): drives = self.find_device_nodes() diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 1205aabf66..517f23fa72 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -77,7 +77,8 @@ class DeviceManager(Thread): ''' Thread.__init__(self) self.setDaemon(True) - self.devices = [[d, False] for d in device_plugins()] + # [Device driver, Showing in GUI, Ejected] + self.devices = [[d, False, False] for d in device_plugins()] self.device = None self.device_class = None self.sleep_time = sleep_time @@ -93,6 +94,8 @@ class DeviceManager(Thread): for device in self.devices: connected = self.scanner.is_device_connected(device[0]) if connected and not device[1]: + if device[2]: + continue try: dev = device[0] dev.reset() @@ -119,13 +122,23 @@ class DeviceManager(Thread): job.abort(Exception(_('Device no longer connected.'))) except Queue.Empty: break + device[2] = False self.device = None self.connected_slot(False) device[1] ^= True def umount_device(self): - self.device.eject() - self.device = None + if self.device is not None: + self.device.eject() + dev = None + for x in self.devices: + if x[0] is self.device: + dev = x + break + if dev is not None: + dev[2] = True + self.connected_slot(False) + def next(self): if not self.jobs.empty(): diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index e82c613da3..0963f7798d 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -185,7 +185,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): self.job_manager) self.device_manager.start() - + ####################### Location View ######################## QObject.connect(self.location_view, SIGNAL('location_selected(PyQt_PyObject)'), @@ -665,6 +665,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): ########################## Connect to device ############################## + def device_detected(self, connected): ''' Called when a device is connected to the computer. diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index 3a4b0131cf..5e18c16281 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -278,8 +278,11 @@ class LibraryServer(object): r = record[FIELD_MAP['formats']] r = r.upper() if r else '' if 'EPUB' in r or 'PDB' in r: + z = record[FIELD_MAP['authors']] + if not z: + z = _('Unknown') authors = ' & '.join([i.replace('|', ',') for i in - record[FIELD_MAP['authors']].split(',')]) + z.split(',')]) extra = [] rating = record[FIELD_MAP['rating']] if rating > 0: diff --git a/src/calibre/web/feeds/recipes/recipe_wash_post.py b/src/calibre/web/feeds/recipes/recipe_wash_post.py index 144e323f20..2140217a03 100644 --- a/src/calibre/web/feeds/recipes/recipe_wash_post.py +++ b/src/calibre/web/feeds/recipes/recipe_wash_post.py @@ -30,7 +30,7 @@ class WashingtonPost(BasicNewsRecipe): def get_article_url(self, article): - return article.get('feedburner_origlink', article.get('link', None)) + return article.get('pheedo_origlink', article.get('link', None)) def print_version(self, url): return url.rpartition('.')[0] + '_pf.html'