Package list ctdconverter / e3bb3a7
Fix for OpenMS Clemens BlanK 5 years ago
1 changed file(s) with 19 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
705705
706706
707707 def get_param_cli_name(param, model):
708 # we generate parameters with colons for subgroups, but not for the topmost parents (OpenMS legacy)
709 if type(param.parent) == ParameterGroup and param.parent.parent != None:
710 if model.cli:
711 warning("Using nested parameter sections (NODE elements) is not compatible with <cli>", py1)
712 return get_param_name(param.parent) + ":" + resolve_param_mapping(param, model)
708 # we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy)
709 if type(param.parent) == ParameterGroup:
710 if not hasattr(param.parent.parent, 'parent'):
711 return resolve_param_mapping(param, model)
712 elif not hasattr(param.parent.parent.parent, 'parent'):
713 return resolve_param_mapping(param, model)
714 else:
715 if model.cli:
716 warning("Using nested parameter sections (NODE elements) is not compatible with <cli>", py1)
717 return get_param_name(param.parent) + ":" + resolve_param_mapping(param, model)
713718 else:
714719 return resolve_param_mapping(param, model)
715720
716721
717722 def get_param_name(param):
718 # we generate parameters with colons for subgroups, but not for the topmost parents (OpenMS legacy)
719 if type(param.parent) == ParameterGroup and param.parent.parent != None:
720 return get_param_name(param.parent) + ":" + param.name
723 # we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy)
724 if type(param.parent) == ParameterGroup:
725 if not hasattr(param.parent.parent, 'parent'):
726 return param.name
727 elif not hasattr(param.parent.parent.parent, 'parent'):
728 return param.name
729 else:
730 return get_param_name(param.parent) + ":" + param.name
721731 else:
722 return param.name
732 return param.name
723733
724734
725735 # some parameters are mapped to command line options, this method helps resolve those mappings, if any