mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow running calibre in debug mode via an environment variable
This commit is contained in:
parent
ea39c2f7e6
commit
0bddbb67ad
@ -87,7 +87,7 @@ else:
|
||||
filesystem_encoding = 'utf-8'
|
||||
|
||||
|
||||
DEBUG = False
|
||||
DEBUG = b'CALIBRE_DEBUG' in os.environ
|
||||
|
||||
|
||||
def debug():
|
||||
|
@ -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)
|
||||
|
@ -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():
|
||||
|
Loading…
x
Reference in New Issue
Block a user