# HG changeset patch # User fubar_too # Date 1621335639 0 # Node ID 34ff94460cc33700df5d86f590bd86c13dbacd9d # Parent 03df06784e56ac85548f494b557dcb317e895f0c Uploaded diff -r 03df06784e56 -r 34ff94460cc3 toolfactory/ToolFactory.py --- a/toolfactory/ToolFactory.py Tue May 18 08:42:29 2021 +0000 +++ b/toolfactory/ToolFactory.py Tue May 18 11:00:39 2021 +0000 @@ -100,7 +100,7 @@ """ def __init__( - self, args, tool_conf_path, new_tool_archive_path, new_tool_name, local_tool_dir, run_test + self, args, tool_conf_path, new_tool_archive_path, new_tool_name, local_tool_dir ): self.args = args self.tool_conf_path = os.path.join(args.galaxy_root, tool_conf_path) @@ -131,7 +131,12 @@ shell=False, ) + def update_toolconf(self, ourdir, ourxml): # path is relative to tools + + def sortchildrenby(parent, attr): + parent[:] = sorted(parent, key=lambda child: child.get(attr)) + localconf = "./local_tool_conf.xml" self.run_rsync(self.tool_conf_path, localconf) tree = ET.parse(localconf) @@ -150,6 +155,7 @@ for xml in ourxml: # may be > 1 if xml not in conf_tools: # new ET.SubElement(TFsection, "tool", {"file": os.path.join('TFtools', xml)}) + sortchildrenby(TFsection,"file") newconf = f"{self.tool_id}_conf" tree.write(newconf, pretty_print=True) self.run_rsync(newconf, self.tool_conf_path) @@ -968,14 +974,13 @@ r.writeShedyml() r.makeTool() r.makeToolTar() - if args.install == "1": + if args.install == "true": TCU = Tool_Conf_Updater( args=args, local_tool_dir=args.local_tools, new_tool_archive_path=r.newtarpath, tool_conf_path=args.tool_conf_path, - new_tool_name=r.tool_name, - run_test = args.run_test + new_tool_name=r.tool_name ) if __name__ == "__main__":