From 8e73b8efef7809d42f342e5cb12bf716a563e56e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Dec 2015 10:35:47 +0530 Subject: [PATCH] Support for the new app layout used with VS 2015 --- src/calibre/devices/usbms/device.py | 3 ++- src/calibre/ebooks/pdf/pdftohtml.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 1df0568b6c..52e0709cc3 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -26,7 +26,8 @@ if isosx: usbobserver, usbobserver_err = plugins['usbobserver'] def eject_exe(): - return os.path.join(os.path.dirname(sys.executable), 'calibre-eject.exe') + base = sys.extensions_location if hasattr(sys, 'new_app_layout') else os.path.dirname(sys.executable) + return os.path.join(base, 'calibre-eject.exe') class USBDevice: diff --git a/src/calibre/ebooks/pdf/pdftohtml.py b/src/calibre/ebooks/pdf/pdftohtml.py index 5820acb7bf..c9e3c32395 100644 --- a/src/calibre/ebooks/pdf/pdftohtml.py +++ b/src/calibre/ebooks/pdf/pdftohtml.py @@ -19,7 +19,8 @@ popen = subprocess.Popen if isosx and hasattr(sys, 'frameworks_dir'): PDFTOHTML = os.path.join(getattr(sys, 'frameworks_dir'), PDFTOHTML) if iswindows and hasattr(sys, 'frozen'): - PDFTOHTML = os.path.join(os.path.dirname(sys.executable), 'pdftohtml.exe') + base = sys.extensions_location if hasattr(sys, 'new_app_layout') else os.path.dirname(sys.executable) + PDFTOHTML = os.path.join(base, 'pdftohtml.exe') popen = partial(subprocess.Popen, creationflags=0x08) # CREATE_NO_WINDOW=0x08 so that no ugly console is popped up if (islinux or isbsd) and getattr(sys, 'frozen', False): PDFTOHTML = os.path.join(sys.executables_location, 'bin', 'pdftohtml')