Add files via upload
This commit is contained in:
6
CLI.py
6
CLI.py
@@ -16,6 +16,7 @@ class ArgumentDefaultsHelpFormatter(argparse.RawTextHelpFormatter):
|
|||||||
def _get_help_string(self, action):
|
def _get_help_string(self, action):
|
||||||
return textwrap.dedent(action.help)
|
return textwrap.dedent(action.help)
|
||||||
|
|
||||||
|
|
||||||
def parse_cli(argv, no_defaults=False):
|
def parse_cli(argv, no_defaults=False):
|
||||||
def defval(value):
|
def defval(value):
|
||||||
return value if not no_defaults else None
|
return value if not no_defaults else None
|
||||||
@@ -109,8 +110,8 @@ def parse_cli(argv, no_defaults=False):
|
|||||||
getattr(ret, name)[player] = value
|
getattr(ret, name)[player] = value
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def apply_settings_file(settings, settings_path):
|
def apply_settings_file(settings, settings_path):
|
||||||
if os.path.exists(settings_path):
|
if os.path.exists(settings_path):
|
||||||
with open(settings_path) as json_file:
|
with open(settings_path) as json_file:
|
||||||
@@ -120,7 +121,6 @@ def apply_settings_file(settings, settings_path):
|
|||||||
return settings
|
return settings
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def parse_settings():
|
def parse_settings():
|
||||||
# set default settings
|
# set default settings
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
Reference in New Issue
Block a user