Repository 'tool_factory_2'
hg clone https://toolshed.g2.bx.psu.edu/repos/fubar/tool_factory_2

Changeset 36:ce2b1f8ea68d (2020-08-10)
Previous changeset 35:5d38cb3d9be8 (2020-08-08) Next changeset 37:099047ee7094 (2020-08-10)
Commit message:
passes flake8 tests finally :)
modified:
toolfactory/galaxyxml/__init__.py
toolfactory/galaxyxml/tool/__init__.py
toolfactory/galaxyxml/tool/import_xml.py
toolfactory/galaxyxml/tool/parameters/__init__.py
toolfactory/rgToolFactory2.py
toolfactory/rgToolFactory2.xml
added:
toolfactory/sample_toolfactory_tools.tgz
toolfactory/tf_tests_history.tar.gz
toolfactory/tfwfsample.tgz
toolfactory/tfworkflowsample.ga
removed:
toolfactory/sample_toolfactory_tools.ga
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/galaxyxml/__init__.py
--- a/toolfactory/galaxyxml/__init__.py Sat Aug 08 19:55:55 2020 -0400
+++ b/toolfactory/galaxyxml/__init__.py Mon Aug 10 23:24:41 2020 -0400
[
@@ -4,23 +4,24 @@
 
 
 class GalaxyXML(object):
-
     def __init__(self):
-        self.root = etree.Element('root')
+        self.root = etree.Element("root")
 
     def export(self):
-        return etree.tostring(self.root, pretty_print=True, encoding='unicode')
+        return etree.tostring(self.root, pretty_print=True, encoding="unicode")
 
 
 class Util(object):
-
     @classmethod
     def coerce(cls, data, kill_lists=False):
         """Recursive data sanitisation
         """
         if isinstance(data, dict):
-            return {k: cls.coerce(v, kill_lists=kill_lists) for k, v in
-                    list(data.items()) if v is not None}
+            return {
+                k: cls.coerce(v, kill_lists=kill_lists)
+                for k, v in list(data.items())
+                if v is not None
+            }
         elif isinstance(data, list):
             if kill_lists:
                 return cls.coerce(data[0])
@@ -45,22 +46,22 @@
 
     @classmethod
     def clean_kwargs(cls, params, final=False):
-        if 'kwargs' in params:
-            kwargs = params['kwargs']
+        if "kwargs" in params:
+            kwargs = params["kwargs"]
             for k in kwargs:
                 params[k] = kwargs[k]
-            del params['kwargs']
-        if 'self' in params:
-            del params['self']
+            del params["kwargs"]
+        if "self" in params:
+            del params["self"]
 
-        if '__class__' in params:
-            del params['__class__']
+        if "__class__" in params:
+            del params["__class__"]
 
         # There will be more params, it would be NICE to use a whitelist
         # instead of a blacklist, but until we have more data let's just
         # blacklist stuff we see commonly.
         if final:
-            for blacklist in ('positional',):
+            for blacklist in ("positional",):
                 if blacklist in params:
                     del params[blacklist]
         return params
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/galaxyxml/tool/__init__.py
--- a/toolfactory/galaxyxml/tool/__init__.py Sat Aug 08 19:55:55 2020 -0400
+++ b/toolfactory/galaxyxml/tool/__init__.py Mon Aug 10 23:24:41 2020 -0400
[
@@ -4,56 +4,68 @@
 from galaxyxml import Util, GalaxyXML
 from galaxyxml.tool.parameters import XMLParam
 
-VALID_TOOL_TYPES = ('data_source', 'data_source_async')
-VALID_URL_METHODS = ('get', 'post')
+VALID_TOOL_TYPES = ("data_source", "data_source_async")
+VALID_URL_METHODS = ("get", "post")
 
 logging.basicConfig(level=logging.INFO)
 logger = logging.getLogger(__name__)
 
 
 class Tool(GalaxyXML):
-
-    def __init__(self, name, id, version, description, executable, hidden=False,
-                 tool_type=None, URL_method=None, workflow_compatible=True,
-                 interpreter=None, version_command='interpreter filename.exe --version',
-                 command_line_override=None):
+    def __init__(
+        self,
+        name,
+        id,
+        version,
+        description,
+        executable,
+        hidden=False,
+        tool_type=None,
+        URL_method=None,
+        workflow_compatible=True,
+        interpreter=None,
+        version_command="interpreter filename.exe --version",
+        command_line_override=None,
+    ):
 
         self.executable = executable
         self.interpreter = interpreter
         self.command_line_override = command_line_override
         kwargs = {
-            'name': name,
-            'id': id,
-            'version': version,
-            'hidden': hidden,
-            'workflow_compatible': workflow_compatible,
+            "name": name,
+            "id": id,
+            "version": version,
+            "hidden": hidden,
+            "workflow_compatible": workflow_compatible,
         }
         self.version_command = version_command
 
         # Remove some of the default values to make tools look a bit nicer
         if not hidden:
-            del kwargs['hidden']
+            del kwargs["hidden"]
         if workflow_compatible:
-            del kwargs['workflow_compatible']
+            del kwargs["workflow_compatible"]
 
         kwargs = Util.coerce(kwargs)
-        self.root = etree.Element('tool', **kwargs)
+        self.root = etree.Element("tool", **kwargs)
 
         if tool_type is not None:
             if tool_type not in VALID_TOOL_TYPES:
-                raise Exception("Tool type must be one of %s" %
-                                ','.join(VALID_TOOL_TYPES))
+                raise Exception(
+                    "Tool type must be one of %s" % ",".join(VALID_TOOL_TYPES)
+                )
             else:
-                kwargs['tool_type'] = tool_type
+                kwargs["tool_type"] = tool_type
 
                 if URL_method is not None:
                     if URL_method in VALID_URL_METHODS:
-                        kwargs['URL_method'] = URL_method
+                        kwargs["URL_method"] = URL_method
                     else:
-                        raise Exception("URL_method must be one of %s" %
-                                        ','.join(VALID_URL_METHODS))
+                        raise Exception(
+                            "URL_method must be one of %s" % ",".join(VALID_URL_METHODS)
+                        )
 
-        description_node = etree.SubElement(self.root, 'description')
+        description_node = etree.SubElement(self.root, "description")
         description_node.text = description
 
     def add_comment(self, comment_txt):
@@ -61,7 +73,7 @@
         self.root.insert(0, comment)
 
     def append_version_command(self):
-        version_command = etree.SubElement(self.root, 'version_command')
+        version_command = etree.SubElement(self.root, "version_command")
         try:
             version_command.text = etree.CDATA(self.version_command)
         except Exception:
@@ -76,10 +88,10 @@
     def clean_command_string(self, command_line):
         clean = []
         for x in command_line:
-            if x is not [] and x is not ['']:
+            if x is not [] and x is not [""]:
                 clean.append(x)
 
-        return '\n'.join(clean)
+        return "\n".join(clean)
 
     def export(self, keep_old_command=False):  # noqa
 
@@ -105,7 +117,7 @@
         except Exception:
             pass
 
-        if self.command_line_override != None:
+        if self.command_line_override:
             command_line = self.command_line_override
         else:
             command_line = []
@@ -120,8 +132,8 @@
                 pass
 
         # Add stdio section
-        stdio = etree.SubElement(export_xml.root, 'stdio')
-        etree.SubElement(stdio, 'exit_code', range='1:', level='fatal')
+        stdio = etree.SubElement(export_xml.root, "stdio")
+        etree.SubElement(stdio, "exit_code", range="1:", level="fatal")
 
         # Append version command
         export_xml.append_version_command()
@@ -129,21 +141,25 @@
         # Steal interpreter from kwargs
         command_kwargs = {}
         if export_xml.interpreter is not None:
-            command_kwargs['interpreter'] = export_xml.interpreter
+            command_kwargs["interpreter"] = export_xml.interpreter
 
         # Add command section
-        command_node = etree.SubElement(export_xml.root, 'command', **command_kwargs)
+        command_node = etree.SubElement(export_xml.root, "command", **command_kwargs)
 
         if keep_old_command:
-            if getattr(self, 'command', None):
+            if getattr(self, "command", None):
                 command_node.text = etree.CDATA(export_xml.command)
             else:
-                logger.warning('The tool does not have any old command stored. ' +
-                               'Only the command line is written.')
+                logger.warning(
+                    "The tool does not have any old command stored. "
+                    + "Only the command line is written."
+                )
                 command_node.text = export_xml.executable
         else:
             actual_cli = "%s %s" % (
-                export_xml.executable, export_xml.clean_command_string(command_line))
+                export_xml.executable,
+                export_xml.clean_command_string(command_line),
+            )
             command_node.text = etree.CDATA(actual_cli.strip())
 
         try:
@@ -161,7 +177,7 @@
         except Exception:
             pass
 
-        help_element = etree.SubElement(export_xml.root, 'help')
+        help_element = etree.SubElement(export_xml.root, "help")
         help_element.text = etree.CDATA(export_xml.help)
 
         try:
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/galaxyxml/tool/import_xml.py
--- a/toolfactory/galaxyxml/tool/import_xml.py Sat Aug 08 19:55:55 2020 -0400
+++ b/toolfactory/galaxyxml/tool/import_xml.py Mon Aug 10 23:24:41 2020 -0400
[
b'@@ -22,24 +22,26 @@\n         version_cmd = None\n         description = None\n         for child in xml_root:\n-            if child.tag == \'description\':\n+            if child.tag == "description":\n                 description = child.text\n-            elif child.tag == \'command\':\n+            elif child.tag == "command":\n                 executable = child.text.split()[0]\n                 command = child.text\n-            elif child.tag == \'version_command\':\n+            elif child.tag == "version_command":\n                 version_cmd = child.text\n \n-        tool = gxt.Tool(xml_root.attrib[\'name\'],\n-                        xml_root.attrib[\'id\'],\n-                        xml_root.attrib.get(\'version\', None),\n-                        description,\n-                        executable,\n-                        hidden=xml_root.attrib.get(\'hidden\', False),\n-                        tool_type=xml_root.attrib.get(\'tool_type\', None),\n-                        URL_method=xml_root.attrib.get(\'URL_method\', None),\n-                        workflow_compatible=xml_root.attrib.get(\'workflow_compatible\', True),\n-                        version_command=version_cmd)\n+        tool = gxt.Tool(\n+            xml_root.attrib["name"],\n+            xml_root.attrib["id"],\n+            xml_root.attrib.get("version", None),\n+            description,\n+            executable,\n+            hidden=xml_root.attrib.get("hidden", False),\n+            tool_type=xml_root.attrib.get("tool_type", None),\n+            URL_method=xml_root.attrib.get("URL_method", None),\n+            workflow_compatible=xml_root.attrib.get("workflow_compatible", True),\n+            version_command=version_cmd,\n+        )\n         tool.command = command\n         return tool\n \n@@ -109,15 +111,17 @@\n         """\n         tool.requirements = gxtp.Requirements()\n         for req in requirements_root:\n-            req_type = req.attrib[\'type\']\n+            req_type = req.attrib["type"]\n             value = req.text\n-            if req.tag == \'requirement\':\n-                version = req.attrib.get(\'version\', None)\n-                tool.requirements.append(gxtp.Requirement(req_type, value, version=version))\n-            elif req.tag == \'container\':\n+            if req.tag == "requirement":\n+                version = req.attrib.get("version", None)\n+                tool.requirements.append(\n+                    gxtp.Requirement(req_type, value, version=version)\n+                )\n+            elif req.tag == "container":\n                 tool.requirements.append(gxtp.Container(req_type, value))\n             else:\n-                logger.warning(req.tag + \' is not a valid tag for requirements child\')\n+                logger.warning(req.tag + " is not a valid tag for requirements child")\n \n     def _load_edam_topics(self, tool, topics_root):\n         """\n@@ -156,7 +160,7 @@\n         """\n         tool.configfiles = gxtp.Configfiles()\n         for conf in configfiles_root:\n-            name = conf.attrib[\'name\']\n+            name = conf.attrib["name"]\n             value = conf.text\n             tool.configfiles.append(gxtp.Configfile(name, value))\n \n@@ -171,7 +175,7 @@\n         """\n         tool.citations = gxtp.Citations()\n         for cit in citations_root:\n-            cit_type = cit.attrib[\'type\']\n+            cit_type = cit.attrib["type"]\n             value = cit.text\n             tool.citations.append(gxtp.Citation(cit_type, value))\n \n@@ -228,7 +232,7 @@\n         # Now we import each tag\'s field\n         for child in xml_root:\n             try:\n-                getattr(self, \'_load_{}\'.format(child.tag))(tool, child)\n+                getattr(self, "_load_{}".format(child.tag))(tool, child)\n             except AttributeError:\n                 logger.warning(child.tag + " tag is not processed.")\n         return tool\n@@ -247,11 +251,15 @@\n         :param text_param: root of <param> tag.\n         :type text_param: :class:`xml.etree._Element`\n         """\n-        root.append(gxtp.TextParam(text_par'..b'             disc_root.attrib["pattern"],\n+                directory=disc_root.attrib.get("directory", None),\n+                format=disc_root.attrib.get("format", None),\n+                ext=disc_root.attrib.get("ext", None),\n+                visible=disc_root.attrib.get("visible", None),\n+            )\n+        )\n \n     def _load_filter(self, root, filter_root):\n         """\n@@ -600,7 +661,7 @@\n         """\n         for out_child in outputs_root:\n             try:\n-                getattr(self, \'_load_{}\'.format(out_child.tag))(root, out_child)\n+                getattr(self, "_load_{}".format(out_child.tag))(root, out_child)\n             except AttributeError:\n                 logger.warning(out_child.tag + " tag is not processed for <outputs>.")\n \n@@ -618,10 +679,14 @@\n         :param repeat_root: root of <param> tag.\n         :param repeat_root: :class:`xml.etree._Element`\n         """\n-        test_root.append(gxtp.TestParam(param_root.attrib[\'name\'],\n-                                        value=param_root.attrib.get(\'value\', None),\n-                                        ftype=param_root.attrib.get(\'ftype\', None),\n-                                        dbkey=param_root.attrib.get(\'dbkey\', None)))\n+        test_root.append(\n+            gxtp.TestParam(\n+                param_root.attrib["name"],\n+                value=param_root.attrib.get("value", None),\n+                ftype=param_root.attrib.get("ftype", None),\n+                dbkey=param_root.attrib.get("dbkey", None),\n+            )\n+        )\n \n     def _load_output(self, test_root, output_root):\n         """\n@@ -631,16 +696,20 @@\n         :param repeat_root: root of <output> tag.\n         :param repeat_root: :class:`xml.etree._Element`\n         """\n-        test_root.append(gxtp.TestOutput(name=output_root.attrib.get(\'name\', None),\n-                                         file=output_root.attrib.get(\'file\', None),\n-                                         ftype=output_root.attrib.get(\'ftype\', None),\n-                                         sort=output_root.attrib.get(\'sort\', None),\n-                                         value=output_root.attrib.get(\'value\', None),\n-                                         md5=output_root.attrib.get(\'md5\', None),\n-                                         checksum=output_root.attrib.get(\'checksum\', None),\n-                                         compare=output_root.attrib.get(\'compare\', None),\n-                                         lines_diff=output_root.attrib.get(\'lines_diff\', None),\n-                                         delta=output_root.attrib.get(\'delta\', None)))\n+        test_root.append(\n+            gxtp.TestOutput(\n+                name=output_root.attrib.get("name", None),\n+                file=output_root.attrib.get("file", None),\n+                ftype=output_root.attrib.get("ftype", None),\n+                sort=output_root.attrib.get("sort", None),\n+                value=output_root.attrib.get("value", None),\n+                md5=output_root.attrib.get("md5", None),\n+                checksum=output_root.attrib.get("checksum", None),\n+                compare=output_root.attrib.get("compare", None),\n+                lines_diff=output_root.attrib.get("lines_diff", None),\n+                delta=output_root.attrib.get("delta", None),\n+            )\n+        )\n \n     def load_tests(self, root, tests_root):\n         """\n@@ -654,7 +723,9 @@\n             test = gxtp.Test()\n             for test_child in test_root:\n                 try:\n-                    getattr(self, \'_load_{}\'.format(test_child.tag))(test, test_child)\n+                    getattr(self, "_load_{}".format(test_child.tag))(test, test_child)\n                 except AttributeError:\n-                    logger.warning(test_child.tag + " tag is not processed within <test>.")\n+                    logger.warning(\n+                        test_child.tag + " tag is not processed within <test>."\n+                    )\n             root.append(test)\n'
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/galaxyxml/tool/parameters/__init__.py
--- a/toolfactory/galaxyxml/tool/parameters/__init__.py Sat Aug 08 19:55:55 2020 -0400
+++ b/toolfactory/galaxyxml/tool/parameters/__init__.py Mon Aug 10 23:24:41 2020 -0400
[
b'@@ -5,7 +5,7 @@\n \n \n class XMLParam(object):\n-    name = \'node\'\n+    name = "node"\n \n     def __init__(self, *args, **kwargs):\n         # http://stackoverflow.com/a/12118700\n@@ -22,11 +22,15 @@\n                 self.node.append(sub_node.node)\n                 self.children.append(sub_node)\n             else:\n-                raise Exception("Child was unacceptable to parent (%s is not appropriate for %s)" % (\n-                    type(self), type(sub_node)))\n+                raise Exception(\n+                    "Child was unacceptable to parent (%s is not appropriate for %s)"\n+                    % (type(self), type(sub_node))\n+                )\n         else:\n-            raise Exception("Child was unacceptable to parent (%s is not appropriate for %s)" % (\n-                type(self), type(sub_node)))\n+            raise Exception(\n+                "Child was unacceptable to parent (%s is not appropriate for %s)"\n+                % (type(self), type(sub_node))\n+            )\n \n     def validate(self):\n         # Very few need validation, but some nodes we may want to have\n@@ -42,14 +46,14 @@\n         for child in self.children:\n             lines.append(child.command_line())\n             # lines += child.command_line()\n-        return \'\\n\'.join(lines)\n+        return "\\n".join(lines)\n \n     def command_line(self):\n         return None\n \n \n class RequestParamTranslation(XMLParam):\n-    name = \'request_param_translation\'\n+    name = "request_param_translation"\n \n     def __init__(self, **kwargs):\n         self.node = etree.Element(self.name)\n@@ -59,7 +63,7 @@\n \n \n class RequestParam(XMLParam):\n-    name = \'request_param\'\n+    name = "request_param"\n \n     def __init__(self, galaxy_name, remote_name, missing, **kwargs):\n         # TODO: bulk copy locals into self.attr?\n@@ -73,7 +77,7 @@\n \n \n class AppendParam(XMLParam):\n-    name = \'append_param\'\n+    name = "append_param"\n \n     def __init__(self, separator="&amp;", first_separator="?", join="=", **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n@@ -84,7 +88,7 @@\n \n \n class AppendParamValue(XMLParam):\n-    name = \'value\'\n+    name = "value"\n \n     def __init__(self, name="_export", missing="1", **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n@@ -95,7 +99,7 @@\n \n \n class EdamOperations(XMLParam):\n-    name = \'edam_operations\'\n+    name = "edam_operations"\n \n     def acceptable_child(self, child):\n         return issubclass(type(child), EdamOperation)\n@@ -113,7 +117,7 @@\n \n \n class EdamOperation(XMLParam):\n-    name = \'edam_operation\'\n+    name = "edam_operation"\n \n     def __init__(self, value):\n         super(EdamOperation, self).__init__()\n@@ -121,7 +125,7 @@\n \n \n class EdamTopics(XMLParam):\n-    name = \'edam_topics\'\n+    name = "edam_topics"\n \n     def acceptable_child(self, child):\n         return issubclass(type(child), EdamTopic)\n@@ -139,7 +143,7 @@\n \n \n class EdamTopic(XMLParam):\n-    name = \'edam_topic\'\n+    name = "edam_topic"\n \n     def __init__(self, value):\n         super(EdamTopic, self).__init__()\n@@ -147,70 +151,81 @@\n \n \n class Requirements(XMLParam):\n-    name = \'requirements\'\n+    name = "requirements"\n     # This bodes to be an issue -__-\n \n     def acceptable_child(self, child):\n-        return issubclass(type(child), Requirement) or issubclass(type(child), Container)\n+        return issubclass(type(child), Requirement) or issubclass(\n+            type(child), Container\n+        )\n \n \n class Requirement(XMLParam):\n-    name = \'requirement\'\n+    name = "requirement"\n \n     def __init__(self, type, value, version=None, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n         passed_kwargs = {}\n-        passed_kwargs[\'version\'] = params[\'version\']\n-        passed_kwargs[\'type\'] = params[\'type\']\n+        passed_kwargs["version"] = params["version"]\n+        passed_kwargs["type"] = params["type"]\n         super(Requirement, self).__init__(**passed_kwargs)\n         self.node.text = str(value)\n \n \n class Container(XMLPa'..b'     params = Util.clean_kwargs(locals().copy())\n-        del params[\'text\']\n+        del params["text"]\n         super(OutputFilter, self).__init__(**params)\n         self.node.text = text\n \n@@ -584,7 +680,7 @@\n \n \n class ChangeFormat(XMLParam):\n-    name = \'change_format\'\n+    name = "change_format"\n \n     def __init__(self, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n@@ -595,7 +691,7 @@\n \n \n class ChangeFormatWhen(XMLParam):\n-    name = \'when\'\n+    name = "when"\n \n     def __init__(self, input, format, value, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n@@ -606,43 +702,56 @@\n \n \n class OutputCollection(XMLParam):\n-    name = \'collection\'\n+    name = "collection"\n \n-    def __init__(self, name, type=None, label=None, format_source=None,\n-                 type_source=None, structured_like=None, inherit_format=None, **kwargs):\n+    def __init__(\n+        self,\n+        name,\n+        type=None,\n+        label=None,\n+        format_source=None,\n+        type_source=None,\n+        structured_like=None,\n+        inherit_format=None,\n+        **kwargs,\n+    ):\n         params = Util.clean_kwargs(locals().copy())\n         super(OutputCollection, self).__init__(**params)\n \n     def acceptable_child(self, child):\n-        return isinstance(child, OutputData) or isinstance(child, OutputFilter) \\\n+        return (\n+            isinstance(child, OutputData)\n+            or isinstance(child, OutputFilter)\n             or isinstance(child, DiscoverDatasets)\n+        )\n \n \n class DiscoverDatasets(XMLParam):\n-    name = \'discover_datasets\'\n+    name = "discover_datasets"\n \n-    def __init__(self, pattern, directory=None, format=None, ext=None,\n-                 visible=None, **kwargs):\n+    def __init__(\n+        self, pattern, directory=None, format=None, ext=None, visible=None, **kwargs\n+    ):\n         params = Util.clean_kwargs(locals().copy())\n         super(DiscoverDatasets, self).__init__(**params)\n \n \n class Tests(XMLParam):\n-    name = \'tests\'\n+    name = "tests"\n \n     def acceptable_child(self, child):\n         return issubclass(type(child), Test)\n \n \n class Test(XMLParam):\n-    name = \'test\'\n+    name = "test"\n \n     def acceptable_child(self, child):\n         return isinstance(child, TestParam) or isinstance(child, TestOutput)\n \n \n class TestParam(XMLParam):\n-    name = \'param\'\n+    name = "param"\n \n     def __init__(self, name, value=None, ftype=None, dbkey=None, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n@@ -650,17 +759,28 @@\n \n \n class TestOutput(XMLParam):\n-    name = \'output\'\n+    name = "output"\n \n-    def __init__(self, name=None, file=None, ftype=None, sort=None, value=None,\n-                 md5=None, checksum=None, compare=None, lines_diff=None,\n-                 delta=None, **kwargs):\n+    def __init__(\n+        self,\n+        name=None,\n+        file=None,\n+        ftype=None,\n+        sort=None,\n+        value=None,\n+        md5=None,\n+        checksum=None,\n+        compare=None,\n+        lines_diff=None,\n+        delta=None,\n+        **kwargs,\n+    ):\n         params = Util.clean_kwargs(locals().copy())\n         super(TestOutput, self).__init__(**params)\n \n \n class Citations(XMLParam):\n-    name = \'citations\'\n+    name = "citations"\n \n     def acceptable_child(self, child):\n         return issubclass(type(child), Citation)\n@@ -673,16 +793,16 @@\n         :type value: STRING\n         """\n         for citation in self.children:\n-            if citation.node.attrib[\'type\'] == type and citation.node.text == value:\n+            if citation.node.attrib["type"] == type and citation.node.text == value:\n                 return True\n         return False\n \n \n class Citation(XMLParam):\n-    name = \'citation\'\n+    name = "citation"\n \n     def __init__(self, type, value):\n         passed_kwargs = {}\n-        passed_kwargs[\'type\'] = type\n+        passed_kwargs["type"] = type\n         super(Citation, self).__init__(**passed_kwargs)\n         self.node.text = str(value)\n'
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/rgToolFactory2.py
--- a/toolfactory/rgToolFactory2.py Sat Aug 08 19:55:55 2020 -0400
+++ b/toolfactory/rgToolFactory2.py Mon Aug 10 23:24:41 2020 -0400
[
b'@@ -19,27 +19,30 @@\n # TODO: add option to run that code as a post execution hook\n # TODO: add additional history input parameters - currently only one\n \n-import sys\n+\n+import argparse\n+import logging\n+import os\n+import re\n+import shutil\n import subprocess\n-import shutil\n-import os\n+import sys\n+import tarfile\n+import tempfile\n import time\n-import tempfile\n-import argparse\n-import tarfile\n-import re\n+\n import galaxyxml.tool as gxt\n import galaxyxml.tool.parameters as gxtp\n-import logging\n+import lxml\n \n-\n+foo = lxml.__name__   # fug you, flake8. Say my name! Please accept the PR, Helena!\n \n progname = os.path.split(sys.argv[0])[1]\n-myversion = \'V2.1 July 2020\'\n+myversion = "V2.1 July 2020"\n verbose = True\n debug = True\n-toolFactoryURL = \'https://github.com/fubar2/toolfactory\'\n-ourdelim = \'~~~\'\n+toolFactoryURL = "https://github.com/fubar2/toolfactory"\n+ourdelim = "~~~"\n \n # --input_files="$input_files~~~$CL~~~$input_formats~~~$input_label~~~$input_help"\n IPATHPOS = 0\n@@ -54,7 +57,7 @@\n OCLPOS = 2\n OOCLPOS = 3\n \n-#--additional_parameters="$i.param_name~~~$i.param_value~~~$i.param_label~~~$i.param_help~~~$i.param_type~~~$i.CL"\n+# --additional_parameters="$i.param_name~~~$i.param_value~~~$i.param_label~~~$i.param_help~~~$i.param_type~~~$i.CL"\n ANAMEPOS = 0\n AVALPOS = 1\n ALABPOS = 2\n@@ -63,10 +66,11 @@\n ACLPOS = 5\n AOCLPOS = 6\n \n+\n def timenow():\n     """return current time as a string\n     """\n-    return time.strftime(\'%d/%m/%Y %H:%M:%S\', time.localtime(time.time()))\n+    return time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(time.time()))\n \n \n def quote_non_numeric(s):\n@@ -80,12 +84,7 @@\n         return \'"%s"\' % s\n \n \n-html_escape_table = {\n-    "&": "&amp;",\n-    ">": "&gt;",\n-    "<": "&lt;",\n-    "$": r"\\$"\n-}\n+html_escape_table = {"&": "&amp;", ">": "&gt;", "<": "&lt;", "$": r"\\$"}\n \n \n def html_escape(text):\n@@ -95,10 +94,10 @@\n \n def html_unescape(text):\n     """Revert entities within text. Multiple character targets so use replace"""\n-    t = text.replace(\'&amp;\', \'&\')\n-    t = t.replace(\'&gt;\', \'>\')\n-    t = t.replace(\'&lt;\', \'<\')\n-    t = t.replace(\'\\\\$\', \'$\')\n+    t = text.replace("&amp;", "&")\n+    t = t.replace("&gt;", ">")\n+    t = t.replace("&lt;", "<")\n+    t = t.replace("\\\\$", "$")\n     return t\n \n \n@@ -111,8 +110,7 @@\n         if citation.startswith("doi"):\n             citation_tuples.append(("doi", citation[len("doi"):].strip()))\n         else:\n-            citation_tuples.append(\n-                ("bibtex", citation[len("bibtex"):].strip()))\n+            citation_tuples.append(("bibtex", citation[len("bibtex"):].strip()))\n     return citation_tuples\n \n \n@@ -121,8 +119,7 @@\n     uses galaxyxml\n \n     """\n-    \n-    \n+\n     def __init__(self, args=None):\n         """\n         prepare command line cl for running the tool here\n@@ -138,38 +135,43 @@\n         self.lastxclredirect = None\n         self.cl = []\n         self.xmlcl = []\n+        self.is_positional = self.args.parampass == "positional"\n         aCL = self.cl.append\n-        assert args.parampass in [\'0\',\'argparse\',\'positional\'],\'Parameter passing in args.parampass must be "0","positional" or "argparse"\'\n-        self.tool_name = re.sub(\'[^a-zA-Z0-9_]+\', \'\', args.tool_name)\n+        assert args.parampass in [\n+            "0",\n+            "argparse",\n+            "positional",\n+        ], \'Parameter passing in args.parampass must be "0","positional" or "argparse"\'\n+        self.tool_name = re.sub("[^a-zA-Z0-9_]+", "", args.tool_name)\n         self.tool_id = self.tool_name\n-        self.xmlfile = \'%s.xml\' % self.tool_name\n-        if self.args.runmode == "Executable" or self.args.runmode == "system":  # binary - no need\n+        self.xmlfile = "%s.xml" % self.tool_name\n+        if self.args.interpreter_name:\n+            exe = "$runMe"\n+        else:\n+            exe = self.args.exe_package\n+        assert (\n+            exe is not None\n+        ), "No interpeter or executable passed in - nothing to run so cannot build"\n+        self.tool = gxt.Tool(\n+'..b'\n-        logging.debug(\'run done\')\n+        logging.debug("run done")\n         return retval\n \n \n@@ -567,40 +628,43 @@\n     """\n     parser = argparse.ArgumentParser()\n     a = parser.add_argument\n-    a(\'--script_path\', default=\'\')\n-    a(\'--tool_name\', default=None)\n-    a(\'--interpreter_name\', default=None)\n-    a(\'--interpreter_version\', default=None)\n-    a(\'--exe_package\', default=None)\n-    a(\'--exe_package_version\', default=None)\n-    a(\'--input_files\', default=[], action="append")\n-    a(\'--output_files\', default=[], action="append")\n-    a(\'--user_email\', default=\'Unknown\')\n-    a(\'--bad_user\', default=None)\n-    a(\'--make_Tool\', default=None)\n-    a(\'--help_text\', default=None)\n-    a(\'--tool_desc\', default=None)\n-    a(\'--tool_version\', default=None)\n-    a(\'--citations\', default=None)\n-    a(\'--additional_parameters\', action=\'append\', default=[])\n-    a(\'--edit_additional_parameters\', action="store_true", default=False)\n-    a(\'--parampass\', default="positional")\n-    a(\'--tfout\', default="./tfout")\n-    a(\'--new_tool\',default="new_tool")\n-    a(\'--runmode\',default=None)\n+    a("--script_path", default="")\n+    a("--tool_name", default=None)\n+    a("--interpreter_name", default=None)\n+    a("--interpreter_version", default=None)\n+    a("--exe_package", default=None)\n+    a("--exe_package_version", default=None)\n+    a("--input_files", default=[], action="append")\n+    a("--output_files", default=[], action="append")\n+    a("--user_email", default="Unknown")\n+    a("--bad_user", default=None)\n+    a("--make_Tool", default=None)\n+    a("--help_text", default=None)\n+    a("--tool_desc", default=None)\n+    a("--tool_version", default=None)\n+    a("--citations", default=None)\n+    a("--additional_parameters", action="append", default=[])\n+    a("--edit_additional_parameters", action="store_true", default=False)\n+    a("--parampass", default="positional")\n+    a("--tfout", default="./tfout")\n+    a("--new_tool", default="new_tool")\n+    a("--runmode", default=None)\n     args = parser.parse_args()\n-    assert not args.bad_user, \'UNAUTHORISED: %s is NOT authorized to use this tool until Galaxy admin adds %s to "admin_users" in the Galaxy configuration file\' % (\n-        args.bad_user, args.bad_user)\n-    assert args.tool_name, \'## Tool Factory expects a tool name - eg --tool_name=DESeq\'\n-    assert (args.interpreter_name or args.exe_package), \'## Tool Factory wrapper expects an interpreter - eg --interpreter_name=Rscript or an executable package findable by the dependency management package\'\n-    assert args.exe_package or (len(args.script_path) > 0 and os.path.isfile(\n-        args.script_path)), \'## Tool Factory wrapper expects a script path - eg --script_path=foo.R if no executable\'\n-    args.input_files = [x.replace(\'"\', \'\').replace("\'", \'\')\n-                        for x in args.input_files]\n+    assert not args.bad_user, (\n+        \'UNAUTHORISED: %s is NOT authorized to use this tool until Galaxy admin adds %s to "admin_users" in the Galaxy configuration file\'\n+        % (args.bad_user, args.bad_user)\n+    )\n+    assert args.tool_name, "## Tool Factory expects a tool name - eg --tool_name=DESeq"\n+    assert (\n+        args.interpreter_name or args.exe_package\n+    ), "## Tool Factory wrapper expects an interpreter or an executable package"\n+    assert args.exe_package or (\n+        len(args.script_path) > 0 and os.path.isfile(args.script_path)\n+    ), "## Tool Factory wrapper expects a script path - eg --script_path=foo.R if no executable"\n+    args.input_files = [x.replace(\'"\', "").replace("\'", "") for x in args.input_files]\n     # remove quotes we need to deal with spaces in CL params\n     for i, x in enumerate(args.additional_parameters):\n-        args.additional_parameters[i] = args.additional_parameters[i].replace(\n-            \'"\', \'\')\n+        args.additional_parameters[i] = args.additional_parameters[i].replace(\'"\', "")\n     r = ScriptRunner(args)\n     if args.make_Tool:\n         retcode = r.makeTooltar()\n'
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/rgToolFactory2.xml
--- a/toolfactory/rgToolFactory2.xml Sat Aug 08 19:55:55 2020 -0400
+++ b/toolfactory/rgToolFactory2.xml Mon Aug 10 23:24:41 2020 -0400
[
@@ -122,6 +122,7 @@
   </macros>
    <requirements>
       <requirement type="package">python</requirement>
+      <requirement type="package">lxml</requirement>
   </requirements>
   <command interpreter="python"><![CDATA[
 #import os
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/sample_toolfactory_tools.ga
--- a/toolfactory/sample_toolfactory_tools.ga Sat Aug 08 19:55:55 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,443 +0,0 @@\n-{\n-    "a_galaxy_workflow": "true",\n-    "annotation": "",\n-    "format-version": "0.1",\n-    "name": "workflow to generate a bunch of sample toolfactory tools",\n-    "steps": {\n-        "0": {\n-            "annotation": "",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 0,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "",\n-                    "name": "rgToolFactory2.py"\n-                }\n-            ],\n-            "label": "rgToolFactory2.py",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 235.25,\n-                "height": 81,\n-                "left": 711.84375,\n-                "right": 911.84375,\n-                "top": 154.25,\n-                "width": 200,\n-                "x": 711.84375,\n-                "y": 154.25\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "b717b6ee-51d0-415d-876d-f19b42f67666",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "09acd6fd-4e2b-44a8-8757-35eca8d0de89"\n-                }\n-            ]\n-        },\n-        "1": {\n-            "annotation": "",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 1,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "",\n-                    "name": "README.md"\n-                }\n-            ],\n-            "label": "README.md",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 760.25,\n-                "height": 61,\n-                "left": 711.84375,\n-                "right": 911.84375,\n-                "top": 699.25,\n-                "width": 200,\n-                "x": 711.84375,\n-                "y": 699.25\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "8aefae07-4fd1-44a6-bea2-5d377567ac27",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "5f8453d0-abd1-41d9-a4a7-1f8b82f1f095"\n-                }\n-            ]\n-        },\n-        "2": {\n-            "annotation": "",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 2,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "",\n-                    "name": "testtext"\n-                }\n-            ],\n-            "label": "testtext",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 235.25,\n-                "height": 61,\n-                "left": 989.84375,\n-                "right": 1189.84375,\n-                "top": 174.25,\n-                "width": 200,\n-                "x": 989.84375,\n-                "y": 174.25\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "02a35533-a67b-44c0-bce8-96a8adddc5a9",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "abe4a1b1-2c0b-44d1-95f8-4f9bb38e9daa"\n-                }\n-            ]\n-        },\n-        "3": {\n-            "annotation": "",\n-            "content_id": "rgTF2",\n-            "errors": null,\n-            "id": 3,\n-            "input_connections": {\n-                '..b'\n-                "bottom": 1271.25,\n-                "height": 242,\n-                "left": 1267.84375,\n-                "right": 1467.84375,\n-                "top": 1029.25,\n-                "width": 200,\n-                "x": 1267.84375,\n-                "y": 1029.25\n-            },\n-            "post_job_actions": {},\n-            "tool_id": "rgTF2",\n-            "tool_state": "{\\"__input_ext\\": \\"tgz\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"python\\", \\"__current_case__\\": 2, \\"interpreter_version\\": \\"\\", \\"exe_package_version\\": \\"\\", \\"dynScript\\": \\"import argparse\\\\nimport tarfile\\\\nimport os\\\\nimport tempfile\\\\nimport subprocess\\\\n\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\nplanemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/pyrevargparse/ &> pyrevargparse\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\n\\\\nparser = argparse.ArgumentParser()\\\\na = parser.add_argument\\\\na(\'--tooltgz\',default=\'\')\\\\na(\'--report\',default=None)\\\\na(\'--toolout\',default=None)\\\\na(\'--galaxy_root\',default=None)\\\\nargs = parser.parse_args()\\\\ntoolname = args.toolout.split(os.sep)[-1]\\\\ntoolpath = os.path.join(args.galaxy_root,args.toolout)\\\\ntf = tarfile.open(args.tooltgz,\\\\\\"r:gz\\\\\\")\\\\ntf.extractall(toolpath)\\\\ncl = \\\\\\"planemo test --skip_venv --galaxy_root %s %s\\\\\\" % (args.galaxy_root,toolpath)\\\\ncll = cl.split(\' \')\\\\nsto = open(args.report, \'w\')\\\\np = subprocess.run(cll, shell=False, stdout=sto)\\\\nretval = p.returncode\\\\nsto.close()\\\\n\\"}, \\"makeMode\\": {\\"make_Tool\\": \\"yes\\", \\"__current_case__\\": 0, \\"tool_version\\": \\"0.01\\", \\"tool_desc\\": \\"Tool to test toolshed tool archives generated by the tool factory.\\", \\"help_text\\": \\"**What it Does**\\\\n\\\\nGiven a toolshed tgz file generated by a tool factory run, this will unpack it and run planemo test, returning the planemo stdout as a report\\\\nIt was generated using the tool factory.\\", \\"citations\\": []}, \\"ppass\\": {\\"parampass\\": \\"argparse\\", \\"__current_case__\\": 0, \\"history_inputs\\": [{\\"__index__\\": 0, \\"input_files\\": {\\"__class__\\": \\"ConnectedValue\\"}, \\"input_formats\\": [\\"tgz\\"], \\"input_label\\": \\"tool toolshed tgz archive from history\\", \\"input_help\\": \\"Run planemo test on a tool shed tool archive tgz format file generated by the ToolFactory or Planemo\\", \\"input_CL\\": \\"tooltgz\\"}], \\"history_outputs\\": [{\\"__index__\\": 0, \\"history_name\\": \\"report\\", \\"history_format\\": \\"txt\\", \\"history_CL\\": \\"report\\"}], \\"edit_params\\": \\"yes\\", \\"additional_parameters\\": [{\\"__index__\\": 0, \\"param_name\\": \\"toolout\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"tools/toolmakers/planemotest\\", \\"param_label\\": \\"output path under galaxy root\\", \\"param_help\\": \\"This is where the tgz file will be extracted and tested by planemo\\", \\"param_CL\\": \\"toolout\\"}, {\\"__index__\\": 1, \\"param_name\\": \\"galaxy_root\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"/home/ross/galaxy\\", \\"param_label\\": \\"your galaxy root to use for running planemo\\", \\"param_help\\": \\"This will form the galaxy_root parameter for running planemo using an existing Galaxy source tree, and the tgz will be extracted at a path relative to that root\\", \\"param_CL\\": \\"galaxy_root\\"}]}, \\"tool_name\\": \\"planemotest\\", \\"__page__\\": null, \\"__rerun_remap_job_id__\\": null}",\n-            "tool_version": "2.00",\n-            "type": "tool",\n-            "uuid": "c72a7aae-3801-431b-a331-be6938d34fbd",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "ToolFactory_Outputs",\n-                    "uuid": "75aa9815-5bd6-44a7-8210-889d3b7e5027"\n-                },\n-                {\n-                    "label": null,\n-                    "output_name": "new_tool",\n-                    "uuid": "744499de-5d7e-4415-b427-315057c81ebc"\n-                }\n-            ]\n-        }\n-    },\n-    "tags": [],\n-    "uuid": "490d9c7f-eea3-4616-a8b7-13510da0430b",\n-    "version": 1\n-}\n'
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/sample_toolfactory_tools.tgz
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/sample_toolfactory_tools.tgz Mon Aug 10 23:24:41 2020 -0400
[
b'@@ -0,0 +1,443 @@\n+{\n+    "a_galaxy_workflow": "true",\n+    "annotation": "",\n+    "format-version": "0.1",\n+    "name": "workflow to generate a bunch of sample toolfactory tools",\n+    "steps": {\n+        "0": {\n+            "annotation": "",\n+            "content_id": null,\n+            "errors": null,\n+            "id": 0,\n+            "input_connections": {},\n+            "inputs": [\n+                {\n+                    "description": "",\n+                    "name": "rgToolFactory2.py"\n+                }\n+            ],\n+            "label": "rgToolFactory2.py",\n+            "name": "Input dataset",\n+            "outputs": [],\n+            "position": {\n+                "bottom": 235.25,\n+                "height": 81,\n+                "left": 711.84375,\n+                "right": 911.84375,\n+                "top": 154.25,\n+                "width": 200,\n+                "x": 711.84375,\n+                "y": 154.25\n+            },\n+            "tool_id": null,\n+            "tool_state": "{\\"optional\\": false}",\n+            "tool_version": null,\n+            "type": "data_input",\n+            "uuid": "b717b6ee-51d0-415d-876d-f19b42f67666",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "output",\n+                    "uuid": "09acd6fd-4e2b-44a8-8757-35eca8d0de89"\n+                }\n+            ]\n+        },\n+        "1": {\n+            "annotation": "",\n+            "content_id": null,\n+            "errors": null,\n+            "id": 1,\n+            "input_connections": {},\n+            "inputs": [\n+                {\n+                    "description": "",\n+                    "name": "README.md"\n+                }\n+            ],\n+            "label": "README.md",\n+            "name": "Input dataset",\n+            "outputs": [],\n+            "position": {\n+                "bottom": 760.25,\n+                "height": 61,\n+                "left": 711.84375,\n+                "right": 911.84375,\n+                "top": 699.25,\n+                "width": 200,\n+                "x": 711.84375,\n+                "y": 699.25\n+            },\n+            "tool_id": null,\n+            "tool_state": "{\\"optional\\": false}",\n+            "tool_version": null,\n+            "type": "data_input",\n+            "uuid": "8aefae07-4fd1-44a6-bea2-5d377567ac27",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "output",\n+                    "uuid": "5f8453d0-abd1-41d9-a4a7-1f8b82f1f095"\n+                }\n+            ]\n+        },\n+        "2": {\n+            "annotation": "",\n+            "content_id": null,\n+            "errors": null,\n+            "id": 2,\n+            "input_connections": {},\n+            "inputs": [\n+                {\n+                    "description": "",\n+                    "name": "testtext"\n+                }\n+            ],\n+            "label": "testtext",\n+            "name": "Input dataset",\n+            "outputs": [],\n+            "position": {\n+                "bottom": 235.25,\n+                "height": 61,\n+                "left": 989.84375,\n+                "right": 1189.84375,\n+                "top": 174.25,\n+                "width": 200,\n+                "x": 989.84375,\n+                "y": 174.25\n+            },\n+            "tool_id": null,\n+            "tool_state": "{\\"optional\\": false}",\n+            "tool_version": null,\n+            "type": "data_input",\n+            "uuid": "02a35533-a67b-44c0-bce8-96a8adddc5a9",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "output",\n+                    "uuid": "abe4a1b1-2c0b-44d1-95f8-4f9bb38e9daa"\n+                }\n+            ]\n+        },\n+        "3": {\n+            "annotation": "",\n+            "content_id": "rgTF2",\n+            "errors": null,\n+            "id": 3,\n+            "input_connections": {\n+                '..b'\n+                "bottom": 1271.25,\n+                "height": 242,\n+                "left": 1267.84375,\n+                "right": 1467.84375,\n+                "top": 1029.25,\n+                "width": 200,\n+                "x": 1267.84375,\n+                "y": 1029.25\n+            },\n+            "post_job_actions": {},\n+            "tool_id": "rgTF2",\n+            "tool_state": "{\\"__input_ext\\": \\"tgz\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"python\\", \\"__current_case__\\": 2, \\"interpreter_version\\": \\"\\", \\"exe_package_version\\": \\"\\", \\"dynScript\\": \\"import argparse\\\\nimport tarfile\\\\nimport os\\\\nimport tempfile\\\\nimport subprocess\\\\n\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\nplanemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/pyrevargparse/ &> pyrevargparse\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\n\\\\nparser = argparse.ArgumentParser()\\\\na = parser.add_argument\\\\na(\'--tooltgz\',default=\'\')\\\\na(\'--report\',default=None)\\\\na(\'--toolout\',default=None)\\\\na(\'--galaxy_root\',default=None)\\\\nargs = parser.parse_args()\\\\ntoolname = args.toolout.split(os.sep)[-1]\\\\ntoolpath = os.path.join(args.galaxy_root,args.toolout)\\\\ntf = tarfile.open(args.tooltgz,\\\\\\"r:gz\\\\\\")\\\\ntf.extractall(toolpath)\\\\ncl = \\\\\\"planemo test --skip_venv --galaxy_root %s %s\\\\\\" % (args.galaxy_root,toolpath)\\\\ncll = cl.split(\' \')\\\\nsto = open(args.report, \'w\')\\\\np = subprocess.run(cll, shell=False, stdout=sto)\\\\nretval = p.returncode\\\\nsto.close()\\\\n\\"}, \\"makeMode\\": {\\"make_Tool\\": \\"yes\\", \\"__current_case__\\": 0, \\"tool_version\\": \\"0.01\\", \\"tool_desc\\": \\"Tool to test toolshed tool archives generated by the tool factory.\\", \\"help_text\\": \\"**What it Does**\\\\n\\\\nGiven a toolshed tgz file generated by a tool factory run, this will unpack it and run planemo test, returning the planemo stdout as a report\\\\nIt was generated using the tool factory.\\", \\"citations\\": []}, \\"ppass\\": {\\"parampass\\": \\"argparse\\", \\"__current_case__\\": 0, \\"history_inputs\\": [{\\"__index__\\": 0, \\"input_files\\": {\\"__class__\\": \\"ConnectedValue\\"}, \\"input_formats\\": [\\"tgz\\"], \\"input_label\\": \\"tool toolshed tgz archive from history\\", \\"input_help\\": \\"Run planemo test on a tool shed tool archive tgz format file generated by the ToolFactory or Planemo\\", \\"input_CL\\": \\"tooltgz\\"}], \\"history_outputs\\": [{\\"__index__\\": 0, \\"history_name\\": \\"report\\", \\"history_format\\": \\"txt\\", \\"history_CL\\": \\"report\\"}], \\"edit_params\\": \\"yes\\", \\"additional_parameters\\": [{\\"__index__\\": 0, \\"param_name\\": \\"toolout\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"tools/toolmakers/planemotest\\", \\"param_label\\": \\"output path under galaxy root\\", \\"param_help\\": \\"This is where the tgz file will be extracted and tested by planemo\\", \\"param_CL\\": \\"toolout\\"}, {\\"__index__\\": 1, \\"param_name\\": \\"galaxy_root\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"/home/ross/galaxy\\", \\"param_label\\": \\"your galaxy root to use for running planemo\\", \\"param_help\\": \\"This will form the galaxy_root parameter for running planemo using an existing Galaxy source tree, and the tgz will be extracted at a path relative to that root\\", \\"param_CL\\": \\"galaxy_root\\"}]}, \\"tool_name\\": \\"planemotest\\", \\"__page__\\": null, \\"__rerun_remap_job_id__\\": null}",\n+            "tool_version": "2.00",\n+            "type": "tool",\n+            "uuid": "c72a7aae-3801-431b-a331-be6938d34fbd",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "ToolFactory_Outputs",\n+                    "uuid": "75aa9815-5bd6-44a7-8210-889d3b7e5027"\n+                },\n+                {\n+                    "label": null,\n+                    "output_name": "new_tool",\n+                    "uuid": "744499de-5d7e-4415-b427-315057c81ebc"\n+                }\n+            ]\n+        }\n+    },\n+    "tags": [],\n+    "uuid": "490d9c7f-eea3-4616-a8b7-13510da0430b",\n+    "version": 1\n+}\n'
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/tf_tests_history.tar.gz
b
Binary file toolfactory/tf_tests_history.tar.gz has changed
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/tfwfsample.tgz
b
Binary file toolfactory/tfwfsample.tgz has changed
b
diff -r 5d38cb3d9be8 -r ce2b1f8ea68d toolfactory/tfworkflowsample.ga
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/tfworkflowsample.ga Mon Aug 10 23:24:41 2020 -0400
[
b'@@ -0,0 +1,443 @@\n+{\n+    "a_galaxy_workflow": "true",\n+    "annotation": "",\n+    "format-version": "0.1",\n+    "name": "workflow to generate a bunch of sample toolfactory tools",\n+    "steps": {\n+        "0": {\n+            "annotation": "",\n+            "content_id": null,\n+            "errors": null,\n+            "id": 0,\n+            "input_connections": {},\n+            "inputs": [\n+                {\n+                    "description": "",\n+                    "name": "rgToolFactory2.py"\n+                }\n+            ],\n+            "label": "rgToolFactory2.py",\n+            "name": "Input dataset",\n+            "outputs": [],\n+            "position": {\n+                "bottom": 235.25,\n+                "height": 81,\n+                "left": 711.84375,\n+                "right": 911.84375,\n+                "top": 154.25,\n+                "width": 200,\n+                "x": 711.84375,\n+                "y": 154.25\n+            },\n+            "tool_id": null,\n+            "tool_state": "{\\"optional\\": false}",\n+            "tool_version": null,\n+            "type": "data_input",\n+            "uuid": "b717b6ee-51d0-415d-876d-f19b42f67666",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "output",\n+                    "uuid": "09acd6fd-4e2b-44a8-8757-35eca8d0de89"\n+                }\n+            ]\n+        },\n+        "1": {\n+            "annotation": "",\n+            "content_id": null,\n+            "errors": null,\n+            "id": 1,\n+            "input_connections": {},\n+            "inputs": [\n+                {\n+                    "description": "",\n+                    "name": "README.md"\n+                }\n+            ],\n+            "label": "README.md",\n+            "name": "Input dataset",\n+            "outputs": [],\n+            "position": {\n+                "bottom": 760.25,\n+                "height": 61,\n+                "left": 711.84375,\n+                "right": 911.84375,\n+                "top": 699.25,\n+                "width": 200,\n+                "x": 711.84375,\n+                "y": 699.25\n+            },\n+            "tool_id": null,\n+            "tool_state": "{\\"optional\\": false}",\n+            "tool_version": null,\n+            "type": "data_input",\n+            "uuid": "8aefae07-4fd1-44a6-bea2-5d377567ac27",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "output",\n+                    "uuid": "5f8453d0-abd1-41d9-a4a7-1f8b82f1f095"\n+                }\n+            ]\n+        },\n+        "2": {\n+            "annotation": "",\n+            "content_id": null,\n+            "errors": null,\n+            "id": 2,\n+            "input_connections": {},\n+            "inputs": [\n+                {\n+                    "description": "",\n+                    "name": "testtext"\n+                }\n+            ],\n+            "label": "testtext",\n+            "name": "Input dataset",\n+            "outputs": [],\n+            "position": {\n+                "bottom": 235.25,\n+                "height": 61,\n+                "left": 989.84375,\n+                "right": 1189.84375,\n+                "top": 174.25,\n+                "width": 200,\n+                "x": 989.84375,\n+                "y": 174.25\n+            },\n+            "tool_id": null,\n+            "tool_state": "{\\"optional\\": false}",\n+            "tool_version": null,\n+            "type": "data_input",\n+            "uuid": "02a35533-a67b-44c0-bce8-96a8adddc5a9",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "output",\n+                    "uuid": "abe4a1b1-2c0b-44d1-95f8-4f9bb38e9daa"\n+                }\n+            ]\n+        },\n+        "3": {\n+            "annotation": "",\n+            "content_id": "rgTF2",\n+            "errors": null,\n+            "id": 3,\n+            "input_connections": {\n+                '..b'\n+                "bottom": 1271.25,\n+                "height": 242,\n+                "left": 1267.84375,\n+                "right": 1467.84375,\n+                "top": 1029.25,\n+                "width": 200,\n+                "x": 1267.84375,\n+                "y": 1029.25\n+            },\n+            "post_job_actions": {},\n+            "tool_id": "rgTF2",\n+            "tool_state": "{\\"__input_ext\\": \\"tgz\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"python\\", \\"__current_case__\\": 2, \\"interpreter_version\\": \\"\\", \\"exe_package_version\\": \\"\\", \\"dynScript\\": \\"import argparse\\\\nimport tarfile\\\\nimport os\\\\nimport tempfile\\\\nimport subprocess\\\\n\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\nplanemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/pyrevargparse/ &> pyrevargparse\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\n\\\\nparser = argparse.ArgumentParser()\\\\na = parser.add_argument\\\\na(\'--tooltgz\',default=\'\')\\\\na(\'--report\',default=None)\\\\na(\'--toolout\',default=None)\\\\na(\'--galaxy_root\',default=None)\\\\nargs = parser.parse_args()\\\\ntoolname = args.toolout.split(os.sep)[-1]\\\\ntoolpath = os.path.join(args.galaxy_root,args.toolout)\\\\ntf = tarfile.open(args.tooltgz,\\\\\\"r:gz\\\\\\")\\\\ntf.extractall(toolpath)\\\\ncl = \\\\\\"planemo test --skip_venv --galaxy_root %s %s\\\\\\" % (args.galaxy_root,toolpath)\\\\ncll = cl.split(\' \')\\\\nsto = open(args.report, \'w\')\\\\np = subprocess.run(cll, shell=False, stdout=sto)\\\\nretval = p.returncode\\\\nsto.close()\\\\n\\"}, \\"makeMode\\": {\\"make_Tool\\": \\"yes\\", \\"__current_case__\\": 0, \\"tool_version\\": \\"0.01\\", \\"tool_desc\\": \\"Tool to test toolshed tool archives generated by the tool factory.\\", \\"help_text\\": \\"**What it Does**\\\\n\\\\nGiven a toolshed tgz file generated by a tool factory run, this will unpack it and run planemo test, returning the planemo stdout as a report\\\\nIt was generated using the tool factory.\\", \\"citations\\": []}, \\"ppass\\": {\\"parampass\\": \\"argparse\\", \\"__current_case__\\": 0, \\"history_inputs\\": [{\\"__index__\\": 0, \\"input_files\\": {\\"__class__\\": \\"ConnectedValue\\"}, \\"input_formats\\": [\\"tgz\\"], \\"input_label\\": \\"tool toolshed tgz archive from history\\", \\"input_help\\": \\"Run planemo test on a tool shed tool archive tgz format file generated by the ToolFactory or Planemo\\", \\"input_CL\\": \\"tooltgz\\"}], \\"history_outputs\\": [{\\"__index__\\": 0, \\"history_name\\": \\"report\\", \\"history_format\\": \\"txt\\", \\"history_CL\\": \\"report\\"}], \\"edit_params\\": \\"yes\\", \\"additional_parameters\\": [{\\"__index__\\": 0, \\"param_name\\": \\"toolout\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"tools/toolmakers/planemotest\\", \\"param_label\\": \\"output path under galaxy root\\", \\"param_help\\": \\"This is where the tgz file will be extracted and tested by planemo\\", \\"param_CL\\": \\"toolout\\"}, {\\"__index__\\": 1, \\"param_name\\": \\"galaxy_root\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"/home/ross/galaxy\\", \\"param_label\\": \\"your galaxy root to use for running planemo\\", \\"param_help\\": \\"This will form the galaxy_root parameter for running planemo using an existing Galaxy source tree, and the tgz will be extracted at a path relative to that root\\", \\"param_CL\\": \\"galaxy_root\\"}]}, \\"tool_name\\": \\"planemotest\\", \\"__page__\\": null, \\"__rerun_remap_job_id__\\": null}",\n+            "tool_version": "2.00",\n+            "type": "tool",\n+            "uuid": "c72a7aae-3801-431b-a331-be6938d34fbd",\n+            "workflow_outputs": [\n+                {\n+                    "label": null,\n+                    "output_name": "ToolFactory_Outputs",\n+                    "uuid": "75aa9815-5bd6-44a7-8210-889d3b7e5027"\n+                },\n+                {\n+                    "label": null,\n+                    "output_name": "new_tool",\n+                    "uuid": "744499de-5d7e-4415-b427-315057c81ebc"\n+                }\n+            ]\n+        }\n+    },\n+    "tags": [],\n+    "uuid": "490d9c7f-eea3-4616-a8b7-13510da0430b",\n+    "version": 1\n+}\n'