mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Refactor
This commit is contained in:
parent
8a758b9c82
commit
b829afe225
@ -287,12 +287,8 @@ class GuiRunner(QObject):
|
||||
|
||||
self.initialize_db()
|
||||
|
||||
def run_in_debug_mode(logpath=None):
|
||||
def get_debug_executable():
|
||||
e = sys.executable if getattr(sys, 'frozen', False) else sys.argv[0]
|
||||
import tempfile, subprocess
|
||||
fd, logpath = tempfile.mkstemp('.txt')
|
||||
os.close(fd)
|
||||
|
||||
if hasattr(sys, 'frameworks_dir'):
|
||||
base = os.path.dirname(sys.frameworks_dir)
|
||||
if 'console.app' not in base:
|
||||
@ -302,6 +298,14 @@ def run_in_debug_mode(logpath=None):
|
||||
else:
|
||||
base, ext = os.path.splitext(e)
|
||||
exe = base + '-debug' + ext
|
||||
return exe
|
||||
|
||||
def run_in_debug_mode(logpath=None):
|
||||
import tempfile, subprocess
|
||||
fd, logpath = tempfile.mkstemp('.txt')
|
||||
os.close(fd)
|
||||
|
||||
exe = get_debug_executable()
|
||||
print 'Starting debug executable:', exe
|
||||
creationflags = 0
|
||||
if iswindows:
|
||||
|
Loading…
x
Reference in New Issue
Block a user