From fc88b9874a7cde5170612088e2d8deac2f8cb16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 14 Nov 2015 14:06:49 +0100 Subject: Allow configuration identifier override Before this change, if identifier was set in configuration no other identifier could be used. This way is identifier from configuration used only when no one is provided as argument. --- mcwrapper | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mcwrapper b/mcwrapper index dab5502..2784305 100755 --- a/mcwrapper +++ b/mcwrapper @@ -11,6 +11,7 @@ from threading import Thread import importlib.machinery as imp ################################################################################# # Load configuration +# This segment is same as in mcmim __all_config_files__ = ( 'mcwrapper.conf', @@ -221,6 +222,7 @@ def print_help(): sys.exit() if __name__ == '__main__': + identifier = None message = [] for arg in sys.argv[1:]: if arg[0] == '-': @@ -243,12 +245,15 @@ if __name__ == '__main__': else: sys.exit("Unknown short argument " + l) continue - if conf.identifier == None: - conf.identifier = arg + if identifier == None: + identifier = arg continue sys.exit("Unknown argument: " + arg) # Parsing args ends + # Set identifier if provided + if identifier: + conf.identifier = identifier # Expand configuration for specified identifier if not conf.identifier: print('Missing server identifier argument!') -- cgit v1.2.3