Support for the new app layout used with VS 2015

This commit is contained in:
Kovid Goyal 2015-12-08 10:35:47 +05:30
parent ac4d8e259a
commit 8e73b8efef
2 changed files with 4 additions and 2 deletions

View File

@ -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:

View File

@ -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')