Add option to not turn on debug mode

This commit is contained in:
Kovid Goyal 2022-07-14 19:41:58 +05:30
parent 57aed7e1aa
commit 1660f2377d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -59,6 +59,7 @@ as a shebang in scripts, like this:
help=_('Run the GUI with a debug console, logging to the' help=_('Run the GUI with a debug console, logging to the'
' specified path. For internal use only, use the -g' ' specified path. For internal use only, use the -g'
' option to run the GUI in debug mode')) ' option to run the GUI in debug mode'))
parser.add_option('--run-without-debug', default=False, action='store_true', help=_('Dont run python code with the DEBUG flag set'))
parser.add_option('-w', '--viewer', default=False, action='store_true', parser.add_option('-w', '--viewer', default=False, action='store_true',
help=_('Run the E-book viewer in debug mode')) help=_('Run the E-book viewer in debug mode'))
parser.add_option('--paths', default=False, action='store_true', parser.add_option('--paths', default=False, action='store_true',
@ -218,6 +219,7 @@ def main(args=sys.argv):
sys.argv = [sys.argv[0], '--multiprocessing-fork'] sys.argv = [sys.argv[0], '--multiprocessing-fork']
exec(args[-1]) exec(args[-1])
return return
if not opts.run_without_debug:
debug() debug()
if opts.gui: if opts.gui:
from calibre.gui_launch import calibre from calibre.gui_launch import calibre