mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
Fix up error message when not specifying a directory with the --config option and add this to 1.1.x
This commit is contained in:
parent
d85d8945e7
commit
1f06be95d1
1 changed files with 12 additions and 8 deletions
|
@ -63,7 +63,7 @@ def start_ui():
|
||||||
\t web -- A web-based interface (http://localhost:8112)\n
|
\t web -- A web-based interface (http://localhost:8112)\n
|
||||||
\t console -- A console or command-line interface""", action="store", type="str")
|
\t console -- A console or command-line interface""", action="store", type="str")
|
||||||
parser.add_option("-c", "--config", dest="config",
|
parser.add_option("-c", "--config", dest="config",
|
||||||
help="Set the config location", action="store", type="str")
|
help="Set the config folder location", action="store", type="str")
|
||||||
parser.add_option("-l", "--logfile", dest="logfile",
|
parser.add_option("-l", "--logfile", dest="logfile",
|
||||||
help="Output to designated logfile instead of stdout", action="store", type="str")
|
help="Output to designated logfile instead of stdout", action="store", type="str")
|
||||||
parser.add_option("-a", "--args", dest="args",
|
parser.add_option("-a", "--args", dest="args",
|
||||||
|
@ -78,6 +78,17 @@ def start_ui():
|
||||||
# Get the options and args from the OptionParser
|
# Get the options and args from the OptionParser
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if options.config:
|
||||||
|
if not os.path.exists(options.config):
|
||||||
|
# Try to create the config folder if it doesn't exist
|
||||||
|
try:
|
||||||
|
os.makedirs(options.config)
|
||||||
|
except Exception, e:
|
||||||
|
pass
|
||||||
|
elif not os.path.isdir(options.config):
|
||||||
|
print "Config option needs to be a directory!"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if options.default_ui:
|
if options.default_ui:
|
||||||
if options.config:
|
if options.config:
|
||||||
deluge.configmanager.set_config_dir(options.config)
|
deluge.configmanager.set_config_dir(options.config)
|
||||||
|
@ -91,13 +102,6 @@ def start_ui():
|
||||||
if options.quiet:
|
if options.quiet:
|
||||||
options.loglevel = "none"
|
options.loglevel = "none"
|
||||||
|
|
||||||
if options.config:
|
|
||||||
if not os.path.exists(options.config):
|
|
||||||
# Try to create the config folder if it doesn't exist
|
|
||||||
try:
|
|
||||||
os.makedirs(options.config)
|
|
||||||
except Exception, e:
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
if not os.path.exists(deluge.common.get_default_config_dir()):
|
if not os.path.exists(deluge.common.get_default_config_dir()):
|
||||||
os.makedirs(deluge.common.get_default_config_dir())
|
os.makedirs(deluge.common.get_default_config_dir())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue