Package list ctdconverter / 02fa169
Fixed default macros file Luis de la Garza 5 years ago
1 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
300300 parser.add_argument("-s", "--skip-tools", dest="skip_tools_file", default=None, required=False,
301301 help="File containing a list of tools for which a Galaxy stub will not be generated. "
302302 "Run with '-h' or '--help' to see a brief example on the format of this file.")
303 parser.add_argument("-m", "--macros", dest="macros_files", default=[['macros.xml']], nargs="+",
303 parser.add_argument("-m", "--macros", dest="macros_files", default=[], nargs="*",
304304 action="append", required=None, help="Import the additional given file(s) as macros. "
305305 "The macros stdio, requirements and advanced_options are required. Please see "
306306 "macros.xml for an example of a valid macros file. Al defined macros will be imported.")
392392 def parse_macros_files(macros_file_names):
393393 macros_to_expand = set()
394394
395 if not macros_file_names:
396 # list is empty, provide the default value
397 warning("Using default macros from macros.xml", 0)
398 macros_file_names = ["macros.xml"]
399
395400 for macros_file_name in macros_file_names:
396401 try:
397402 macros_file = open(macros_file_name)
403 info("Loading macros from %s" % macros_file_name, 0)
398404 root = parse(macros_file).getroot()
399405 for xml_element in root.findall("xml"):
400406 name = xml_element.attrib["name"]
402408 warning("Macro %s has already been found. Duplicate found in file %s." %
403409 (name, macros_file_name), 0)
404410 else:
411 info("Macro %s found" % name, 1)
405412 macros_to_expand.add(name)
406413 except ParseError, e:
407414 raise ApplicationException("The macros file " + macros_file_name + " could not be parsed. Cause: " +