diff options
author | Karel Kočí <cynerd@email.cz> | 2015-11-14 14:06:49 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-11-14 14:06:49 +0100 |
commit | fc88b9874a7cde5170612088e2d8deac2f8cb16c (patch) | |
tree | 8e37b34373a259114f8e52bfdbcce2d40130ed2b /mcwrapper | |
parent | 393547afa95e95e7c125f51656755e4165428364 (diff) | |
download | mcserver-wrapper-fc88b9874a7cde5170612088e2d8deac2f8cb16c.tar.gz mcserver-wrapper-fc88b9874a7cde5170612088e2d8deac2f8cb16c.tar.bz2 mcserver-wrapper-fc88b9874a7cde5170612088e2d8deac2f8cb16c.zip |
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.
Diffstat (limited to 'mcwrapper')
-rwxr-xr-x | mcwrapper | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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!') |