mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
df49debcf8
commit
ca693798c3
@ -874,16 +874,19 @@ def setup_gui_option_parser(parser):
|
|||||||
parser.add_option('--detach', default=False, action='store_true',
|
parser.add_option('--detach', default=False, action='store_true',
|
||||||
help=_('Detach from the controlling terminal, if any (linux only)'))
|
help=_('Detach from the controlling terminal, if any (linux only)'))
|
||||||
|
|
||||||
|
def do_detach():
|
||||||
|
# Detach from the controlling process.
|
||||||
|
if os.fork() != 0:
|
||||||
|
raise SystemExit(0)
|
||||||
|
os.setsid()
|
||||||
|
try:
|
||||||
|
plugins['speedup'][0].detach(os.devnull)
|
||||||
|
except AttributeError:
|
||||||
|
pass # people running from source without updated binaries
|
||||||
|
|
||||||
def detach_gui():
|
def detach_gui():
|
||||||
if islinux and not DEBUG:
|
if islinux and not DEBUG:
|
||||||
# Detach from the controlling process.
|
do_detach()
|
||||||
if os.fork() != 0:
|
|
||||||
raise SystemExit(0)
|
|
||||||
os.setsid()
|
|
||||||
try:
|
|
||||||
plugins['speedup'][0].detach(os.devnull)
|
|
||||||
except AttributeError:
|
|
||||||
pass # people running from source without updated binaries
|
|
||||||
|
|
||||||
class Application(QApplication):
|
class Application(QApplication):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user