Skip to content
Snippets Groups Projects
Commit 2ddedadc authored by BRONES Romain's avatar BRONES Romain
Browse files

feat(cli): Add the mossibility to dump configuration

* Also specify in doctring of load config that configuration are superseded
parent 6550d1c4
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ def logdebugconf():
def loadconfig(filepath):
"""
Load a configuration file for the module.
It initialize the internal configuration.
It supersed the default configuration, if found.
PARAMETERS
----------
......
......@@ -52,6 +52,9 @@ if __name__ == '__main__':
parser.add_argument("--stop-ccn", action="store_true",
help="Stop command for the ComBPM applications blocks.")
parser.add_argument("--dump-configuration", type=argparse.FileType('w'),
help="Dump the current configuration in a file at the giver path.")
parser.add_argument("--configure", choices=["combpm", "ccn", "comcorr", "corr", "all"],
nargs='?', const='all',
help="Configuration commands for the Fofb applications blocs."+
......@@ -77,6 +80,11 @@ if __name__ == '__main__':
FofbTool.Configuration.loadconfig(args.fileconfig)
FofbTool.Configuration.logdebugconf()
if not args.dump_configuration is None:
FofbTool.Configuration.config.write(args.dump_configuration)
args.dump_configuration.close()
## Check running
if not FofbTool.Utils.check_fofbnotrunning():
logger.warning("FOFB is running")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment