Provide a CLI option for changing configurations
3 unresolved threads
3 unresolved threads
Merge request reports
Activity
Filter activity
- webservice/update_config.py 0 → 100644
27 28 # remove help calls as they will cause the argument parser to exit 29 add_help = False 30 if "-h" in sys.argv: 31 sys.argv.remove("-h") 32 add_help = True 33 if "--help" in sys.argv: 34 sys.argv.remove("--help") 35 add_help = True 36 37 known, remaining = parser.parse_known_args() 38 args = vars(known) 39 detector = args["detector"] 40 41 for option, typ in available_options[detector].items(): 42 parser.add_argument(f"--{option}", type=typ) Is it make sense to add help message to each option?
Edited by Mikhail KarnevskiyYes... I kind of shied out of that, because then the dictionary containing type and name mapping would become bloated. I'd suggest separate that into a separate MR, where we move the configuration to a yaml file after MID has done initial testing. What do you think?
Edited by Steffen Haufchanged this line in version 4 of the diff
112 113 socket.send(Success.UPLOADED_CONFIG.format(cycle, proposal).encode()) 113 114 114 115 116 def merge(source, destination): 117 """ 118 Deep merge two dictionaries 119 120 :param source: source dictionary to merge into destination 121 :param destination: destination dictionary which is being merged in 122 :return: the updated destination dictionary 123 124 Taken from: https://stackoverflow.com/questions/20656135/python-deep-merge-dictionary-data changed this line in version 2 of the diff
- webservice/update_config.py 0 → 100644
30 if "-h" in sys.argv: 31 sys.argv.remove("-h") 32 add_help = True 33 if "--help" in sys.argv: 34 sys.argv.remove("--help") 35 add_help = True 36 37 known, remaining = parser.parse_known_args() 38 args = vars(known) 39 detector = args["detector"] 40 41 for option, typ in available_options[detector].items(): 42 parser.add_argument(f"--{option}", type=typ) 43 44 if add_help: 45 sys.argv.append("--help") changed this line in version 3 of the diff
@karnem Tests has been done successfully and can be seen on calibration_configurations remote repository and changes have been pushed to this branch. Please review last changes so we can merge and ask Johannes to try after.
mentioned in commit fdafde0d
Please register or sign in to reply