mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-10 10:28:39 +00:00
add the option to fork the webui
This commit is contained in:
parent
4b79ae8280
commit
9ab638377b
2 changed files with 14 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
||||||
==== Web ====
|
==== Web ====
|
||||||
* Fix changing of the allocation in the preferences.
|
* Fix changing of the allocation in the preferences.
|
||||||
* Fix updating the Connection Manager when a host is added.
|
* Fix updating the Connection Manager when a host is added.
|
||||||
|
* Add a --fork option to allow forking the webui to the background
|
||||||
|
|
||||||
==== Misc ====
|
==== Misc ====
|
||||||
* Add man pages for deluge-console and deluge-gtk
|
* Add man pages for deluge-console and deluge-gtk
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from deluge.ui.ui import _UI, UI
|
from deluge.ui.ui import _UI, UI
|
||||||
from optparse import OptionGroup
|
from optparse import OptionGroup
|
||||||
|
|
||||||
|
@ -51,6 +53,9 @@ class Web(_UI):
|
||||||
self.__server = None
|
self.__server = None
|
||||||
|
|
||||||
group = OptionGroup(self.parser, "Web Options")
|
group = OptionGroup(self.parser, "Web Options")
|
||||||
|
group.add_option("-f", "--fork", dest="fork",
|
||||||
|
help="Fork the web interface process into the background",
|
||||||
|
action="store_true", default=False)
|
||||||
group.add_option("-p", "--port", dest="port", type="int",
|
group.add_option("-p", "--port", dest="port", type="int",
|
||||||
help="Sets the port to be used for the webserver",
|
help="Sets the port to be used for the webserver",
|
||||||
action="store", default=None)
|
action="store", default=None)
|
||||||
|
@ -72,6 +77,11 @@ class Web(_UI):
|
||||||
def start(self):
|
def start(self):
|
||||||
super(Web, self).start()
|
super(Web, self).start()
|
||||||
|
|
||||||
|
if self.options.fork:
|
||||||
|
if os.fork():
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
|
||||||
import server
|
import server
|
||||||
self.__server = server.DelugeWeb()
|
self.__server = server.DelugeWeb()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue