Allow running calibre in debug mode via an environment variable

This commit is contained in:
Kovid Goyal
2017-05-14 21:55:59 +05:30
parent ea39c2f7e6
commit 0bddbb67ad
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ else:
filesystem_encoding = 'utf-8'
DEBUG = False
DEBUG = b'CALIBRE_DEBUG' in os.environ
def debug():
-1
View File
@@ -250,7 +250,6 @@ def main(args=sys.argv):
opts, args = option_parser().parse_args(args)
if opts.gui:
from calibre.gui_launch import calibre
print_basic_debug_info()
calibre(['calibre'])
elif opts.gui_debug is not None:
run_debug_gui(opts.gui_debug)
+4
View File
@@ -63,6 +63,10 @@ def register_with_default_programs():
def calibre(args=sys.argv):
from calibre.constants import DEBUG
if DEBUG:
from calibre.debug import print_basic_debug_info
print_basic_debug_info()
detach_gui()
init_dbus()
with register_with_default_programs():