- epilog=f'{PROGRAM_NAME} uses config.py ({__file__}) for global, cross-module configuration setup and parsing.',
+ epilog=f"{PROGRAM_NAME} uses config.py ({__file__}) for global, cross-module configuration setup and parsing.",
# I don't fully understand why but when loaded by sphinx sometimes
# the same module is loaded many times causing any arguments it
# registers via module-level code to be redefined. Work around
# this iff the program is 'sphinx-build'
# I don't fully understand why but when loaded by sphinx sometimes
# the same module is loaded many times causing any arguments it
# registers via module-level code to be redefined. Work around
# this iff the program is 'sphinx-build'
- conflict_handler='resolve' if PROGRAM_NAME == 'sphinx-build' else 'error',
+ conflict_handler="resolve" if PROGRAM_NAME == "sphinx-build" else "error",
)
# Arguments specific to config.py. Other users should get their own group by
# invoking config.add_commandline_args.
GROUP = ARGS.add_argument_group(
)
# Arguments specific to config.py. Other users should get their own group by
# invoking config.add_commandline_args.
GROUP = ARGS.add_argument_group(
- f'Global Config ({__file__})',
- 'Args that control the global config itself; how meta!',
+ f"Global Config ({__file__})",
+ "Args that control the global config itself; how meta!",
)
GROUP.add_argument(
)
GROUP.add_argument(
- '--config_loadfile',
- metavar='FILENAME',
+ "--config_loadfile",
+ metavar="FILENAME",
default=None,
help='Config file (populated via --config_savefile) from which to read args in lieu or in addition to those passed via the commandline. Note that if the given path begins with "zk:" then it is interpreted as a zookeeper path instead of as a filesystem path. When loading config from zookeeper, any argument with the string "dynamic" in the name (e.g. --module_dynamic_url) may be modified at runtime by changes made to zookeeper (using --config_savefile=zk:path). You should therefore either write your code to handle dynamic argument changes or avoid naming arguments "dynamic" if you use zookeeper configuration paths.',
)
GROUP.add_argument(
default=None,
help='Config file (populated via --config_savefile) from which to read args in lieu or in addition to those passed via the commandline. Note that if the given path begins with "zk:" then it is interpreted as a zookeeper path instead of as a filesystem path. When loading config from zookeeper, any argument with the string "dynamic" in the name (e.g. --module_dynamic_url) may be modified at runtime by changes made to zookeeper (using --config_savefile=zk:path). You should therefore either write your code to handle dynamic argument changes or avoid naming arguments "dynamic" if you use zookeeper configuration paths.',
)
GROUP.add_argument(
- '--config_dump',
+ "--config_dump",
default=False,
default=False,
- action='store_true',
- help='Display the global configuration (possibly derived from multiple sources) on STDERR at program startup time.',
+ action="store_true",
+ help="Display the global configuration (possibly derived from multiple sources) on STDERR at program startup time.",
)
GROUP.add_argument(
)
GROUP.add_argument(
- '--config_savefile',
+ "--config_savefile",
type=str,
type=str,
- metavar='FILENAME',
+ metavar="FILENAME",
default=None,
help='Populate a config file (compatible with --config_loadfile) and write it at the given path for later [re]use. If the given path begins with "zk:" it is interpreted as a zookeeper path instead of a local filesystem path. When updating zookeeper-based configs, all running programs that read their configuration from zookeeper (via --config_loadfile=zk:<path>) will see the update. Those that also enabled --config_allow_dynamic_updates will change the value of any flags with the string "dynamic" in their names (e.g. --my_dynamic_flag or --dynamic_database_connect_string).',
)
GROUP.add_argument(
default=None,
help='Populate a config file (compatible with --config_loadfile) and write it at the given path for later [re]use. If the given path begins with "zk:" it is interpreted as a zookeeper path instead of a local filesystem path. When updating zookeeper-based configs, all running programs that read their configuration from zookeeper (via --config_loadfile=zk:<path>) will see the update. Those that also enabled --config_allow_dynamic_updates will change the value of any flags with the string "dynamic" in their names (e.g. --my_dynamic_flag or --dynamic_database_connect_string).',
)
GROUP.add_argument(
- '--config_allow_dynamic_updates',
+ "--config_allow_dynamic_updates",
default=False,
default=False,
- action='store_true',
+ action="store_true",
help='If enabled, allow config flags with the string "dynamic" in their names to change at runtime when a new Zookeeper based configuration is created. See the --config_savefile help message for more information about this option.',
)
GROUP.add_argument(
help='If enabled, allow config flags with the string "dynamic" in their names to change at runtime when a new Zookeeper based configuration is created. See the --config_savefile help message for more information about this option.',
)
GROUP.add_argument(
- '--config_rejects_unrecognized_arguments',
+ "--config_rejects_unrecognized_arguments",
default=False,
default=False,
- action='store_true',
- help='If present, config will raise an exception if it doesn\'t recognize an argument. The default behavior is to ignore unknown arguments so as to allow interoperability with programs that want to use their own argparse calls to parse their own, separate commandline args.',
+ action="store_true",
+ help="If present, config will raise an exception if it doesn't recognize an argument. The default behavior is to ignore unknown arguments so as to allow interoperability with programs that want to use their own argparse calls to parse their own, separate commandline args.",
)
GROUP.add_argument(
)
GROUP.add_argument(
- '--config_exit_after_parse',
+ "--config_exit_after_parse",
default=False,
default=False,
- action='store_true',
- help='If present, halt the program after parsing config. Useful, for example, to write a --config_savefile and then terminate.',
+ action="store_true",
+ help="If present, halt the program after parsing config. Useful, for example, to write a --config_savefile and then terminate.",