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

Changeset 38:a30536c100bf (2020-08-12)
Previous changeset 37:099047ee7094 (2020-08-10) Next changeset 39:2cd6555baf44 (2020-08-12)
Commit message:
Updated history outputs
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/galaxyxml/__pycache__/__init__.cpython-36.pyc
toolfactory/galaxyxml/tool/__pycache__/__init__.cpython-36.pyc
toolfactory/galaxyxml/tool/parameters/__pycache__/__init__.cpython-36.pyc
toolfactory/testtf.sh
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/__init__.py
--- a/toolfactory/galaxyxml/__init__.py Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/galaxyxml/__init__.py Wed Aug 12 01:43:46 2020 -0400
[
@@ -1,5 +1,6 @@
+from builtins import object
 from builtins import str
-from builtins import object
+
 from lxml import etree
 
 
@@ -17,11 +18,7 @@
         """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])
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/__pycache__/__init__.cpython-36.pyc
b
Binary file toolfactory/galaxyxml/__pycache__/__init__.cpython-36.pyc has changed
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/tool/__init__.py
--- a/toolfactory/galaxyxml/tool/__init__.py Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/galaxyxml/tool/__init__.py Wed Aug 12 01:43:46 2020 -0400
[
@@ -1,8 +1,10 @@
 import copy
 import logging
+
+from galaxyxml import GalaxyXML, Util
+from galaxyxml.tool.parameters import XMLParam
+
 from lxml import etree
-from galaxyxml import Util, GalaxyXML
-from galaxyxml.tool.parameters import XMLParam
 
 VALID_TOOL_TYPES = ("data_source", "data_source_async")
 VALID_URL_METHODS = ("get", "post")
@@ -12,6 +14,7 @@
 
 
 class Tool(GalaxyXML):
+
     def __init__(
         self,
         name,
@@ -51,9 +54,7 @@
 
         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
 
@@ -61,9 +62,7 @@
                     if URL_method in VALID_URL_METHODS:
                         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.text = description
@@ -150,16 +149,10 @@
             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),
-            )
+            actual_cli = "%s %s" % (export_xml.executable, export_xml.clean_command_string(command_line))
             command_node.text = etree.CDATA(actual_cli.strip())
 
         try:
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/tool/__pycache__/__init__.cpython-36.pyc
b
Binary file toolfactory/galaxyxml/tool/__pycache__/__init__.cpython-36.pyc has changed
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/tool/import_xml.py
--- a/toolfactory/galaxyxml/tool/import_xml.py Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/galaxyxml/tool/import_xml.py Wed Aug 12 01:43:46 2020 -0400
[
@@ -1,5 +1,6 @@
 import logging
 import xml.etree.ElementTree as ET
+
 import galaxyxml.tool as gxt
 import galaxyxml.tool.parameters as gxtp
 
@@ -115,9 +116,7 @@
             value = req.text
             if req.tag == "requirement":
                 version = req.attrib.get("version", None)
-                tool.requirements.append(
-                    gxtp.Requirement(req_type, value, version=version)
-                )
+                tool.requirements.append(gxtp.Requirement(req_type, value, version=version))
             elif req.tag == "container":
                 tool.requirements.append(gxtp.Container(req_type, value))
             else:
@@ -350,9 +349,7 @@
         """
         root.append(
             gxtp.SelectOption(
-                option.attrib.get("value", None),
-                option.text,
-                selected=option.attrib.get("selected", False),
+                option.attrib.get("value", None), option.text, selected=option.attrib.get("selected", False)
             )
         )
 
@@ -432,13 +429,9 @@
         # Deal with child nodes (usually option and options)
         for sel_child in sel_param:
             try:
-                getattr(self, "_load_{}_select".format(sel_child.tag))(
-                    select_param, sel_child
-                )
+                getattr(self, "_load_{}_select".format(sel_child.tag))(select_param, sel_child)
             except AttributeError:
-                logger.warning(
-                    sel_child.tag + " tag is not processed for <param type='select'>."
-                )
+                logger.warning(sel_child.tag + " tag is not processed for <param type='select'>.")
         root.append(select_param)
 
     def _load_param(self, root, param_root):
@@ -539,12 +532,7 @@
             try:
                 getattr(self, "_load_{}".format(inp_child.tag))(root, inp_child)
             except AttributeError:
-                logger.warning(
-                    inp_child.tag
-                    + " tag is not processed for <"
-                    + inputs_root.tag
-                    + "> tag."
-                )
+                logger.warning(inp_child.tag + " tag is not processed for <" + inputs_root.tag + "> tag.")
 
 
 class OutputsParser(object):
@@ -589,9 +577,7 @@
         for chfmt_child in chfmt_root:
             change_format.append(
                 gxtp.ChangeFormatWhen(
-                    chfmt_child.attrib["input"],
-                    chfmt_child.attrib["format"],
-                    chfmt_child.attrib["value"],
+                    chfmt_child.attrib["input"], chfmt_child.attrib["format"], chfmt_child.attrib["value"]
                 )
             )
         root.append(change_format)
@@ -618,9 +604,7 @@
             try:
                 getattr(self, "_load_{}".format(coll_child.tag))(collection, coll_child)
             except AttributeError:
-                logger.warning(
-                    coll_child.tag + " tag is not processed for <collection>."
-                )
+                logger.warning(coll_child.tag + " tag is not processed for <collection>.")
         outputs_root.append(collection)
 
     def _load_discover_datasets(self, root, disc_root):
@@ -725,7 +709,5 @@
                 try:
                     getattr(self, "_load_{}".format(test_child.tag))(test, test_child)
                 except AttributeError:
-                    logger.warning(
-                        test_child.tag + " tag is not processed within <test>."
-                    )
+                    logger.warning(test_child.tag + " tag is not processed within <test>.")
             root.append(test)
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/tool/parameters/__init__.py
--- a/toolfactory/galaxyxml/tool/parameters/__init__.py Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/galaxyxml/tool/parameters/__init__.py Wed Aug 12 01:43:46 2020 -0400
[
b'@@ -1,7 +1,10 @@\n+from builtins import object\n from builtins import str\n-from builtins import object\n+\n+from galaxyxml import Util\n+\n from lxml import etree\n-from galaxyxml import Util\n+\n \n \n class XMLParam(object):\n@@ -23,13 +26,11 @@\n                 self.children.append(sub_node)\n             else:\n                 raise Exception(\n-                    "Child was unacceptable to parent (%s is not appropriate for %s)"\n-                    % (type(self), type(sub_node))\n+                    "Child was unacceptable to parent (%s is not appropriate for %s)" % (type(self), type(sub_node))\n                 )\n         else:\n             raise Exception(\n-                "Child was unacceptable to parent (%s is not appropriate for %s)"\n-                % (type(self), type(sub_node))\n+                "Child was unacceptable to parent (%s is not appropriate for %s)" % (type(self), type(sub_node))\n             )\n \n     def validate(self):\n@@ -155,9 +156,7 @@\n     # This bodes to be an issue -__-\n \n     def acceptable_child(self, child):\n-        return issubclass(type(child), Requirement) or issubclass(\n-            type(child), Container\n-        )\n+        return issubclass(type(child), Requirement) or issubclass(type(child), Container)\n \n \n class Requirement(XMLParam):\n@@ -187,9 +186,7 @@\n     name = "configfiles"\n \n     def acceptable_child(self, child):\n-        return issubclass(type(child), Configfile) or issubclass(\n-            type(child), ConfigfileDefaultInputs\n-        )\n+        return issubclass(type(child), Configfile) or issubclass(type(child), ConfigfileDefaultInputs)\n \n \n class Configfile(XMLParam):\n@@ -217,15 +214,7 @@\n     name = "inputs"\n     # This bodes to be an issue -__-\n \n-    def __init__(\n-        self,\n-        action=None,\n-        check_value=None,\n-        method=None,\n-        target=None,\n-        nginx_upload=None,\n-        **kwargs,\n-    ):\n+    def __init__(self, action=None, check_value=None, method=None, target=None, nginx_upload=None, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n         super(Inputs, self).__init__(**params)\n \n@@ -262,9 +251,7 @@\n             # TODO: replace with positional attribute\n             if len(self.flag()) > 0:\n                 if kwargs["label"] is None:\n-                    kwargs[\n-                        "label"\n-                    ] = "Author did not provide help for this parameter... "\n+                    kwargs["label"] = "Author did not provide help for this parameter... "\n                 if not self.positional:\n                     kwargs["argument"] = self.flag()\n \n@@ -297,11 +284,7 @@\n             if self.positional:\n                 return self.mako_name()\n             else:\n-                return "%s%s%s" % (\n-                    self.flag(),\n-                    self.space_between_arg,\n-                    self.mako_name(),\n-                )\n+                return "%s%s%s" % (self.flag(), self.space_between_arg, self.mako_name())\n \n     def mako_name(self):\n         # TODO: enhance logic to check up parents for things like\n@@ -353,9 +336,7 @@\n         super(Conditional, self).__init__(**params)\n \n     def acceptable_child(self, child):\n-        return issubclass(type(child), InputParameter) and not isinstance(\n-            child, Conditional\n-        )\n+        return issubclass(type(child), InputParameter) and not isinstance(child, Conditional)\n \n     def validate(self):\n         # Find a way to check if one of the kids is a WHEN\n@@ -383,22 +364,16 @@\n         super(Param, self).__init__(**params)\n \n         if type(self) == Param:\n-            raise Exception(\n-                "Param class is not an actual parameter type, use a subclass of Param"\n-            )\n+            raise Exception("Param class is not an actual parameter type, use a subclass of Param")\n \n     def acceptable_child(self, child):\n-        return issubclass(\n-            type(child, InputParameter) or isinstance(child), ValidatorParam\n-        )\n+        '..b' -440,15 +405,7 @@\n     type = "boolean"\n \n     def __init__(\n-        self,\n-        name,\n-        optional=None,\n-        label=None,\n-        help=None,\n-        checked=False,\n-        truevalue=None,\n-        falsevalue=None,\n-        **kwargs,\n+        self, name, optional=None, label=None, help=None, checked=False, truevalue=None, falsevalue=None, **kwargs\n     ):\n         params = Util.clean_kwargs(locals().copy())\n \n@@ -477,16 +434,7 @@\n class DataParam(Param):\n     type = "data"\n \n-    def __init__(\n-        self,\n-        name,\n-        optional=None,\n-        label=None,\n-        help=None,\n-        format=None,\n-        multiple=None,\n-        **kwargs,\n-    ):\n+    def __init__(self, name, optional=None, label=None, help=None, format=None, multiple=None, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n         super(DataParam, self).__init__(**params)\n \n@@ -505,7 +453,7 @@\n         multiple=None,\n         options=None,\n         default=None,\n-        **kwargs,\n+        **kwargs\n     ):\n         params = Util.clean_kwargs(locals().copy())\n         del params["options"]\n@@ -544,14 +492,7 @@\n class Options(InputParameter):\n     name = "options"\n \n-    def __init__(\n-        self,\n-        from_dataset=None,\n-        from_file=None,\n-        from_data_table=None,\n-        from_parameter=None,\n-        **kwargs,\n-    ):\n+    def __init__(self, from_dataset=None, from_file=None, from_data_table=None, from_parameter=None, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n         super(Options, self).__init__(None, **params)\n \n@@ -583,7 +524,7 @@\n         value=None,\n         ref_attribute=None,\n         index=None,\n-        **kwargs,\n+        **kwargs\n     ):\n         params = Util.clean_kwargs(locals().copy())\n         super(Filter, self).__init__(**params)\n@@ -602,7 +543,7 @@\n         line_startswith=None,\n         min=None,\n         max=None,\n-        **kwargs,\n+        **kwargs\n     ):\n         params = Util.clean_kwargs(locals().copy())\n         super(ValidatorParam, self).__init__(**params)\n@@ -630,7 +571,7 @@\n         label=None,\n         from_work_dir=None,\n         hidden=False,\n-        **kwargs,\n+        **kwargs\n     ):\n         # TODO: validate format_source&metadata_source against something in the\n         # XMLParam children tree.\n@@ -659,11 +600,7 @@\n         return flag + self.mako_identifier\n \n     def acceptable_child(self, child):\n-        return (\n-            isinstance(child, OutputFilter)\n-            or isinstance(child, ChangeFormat)\n-            or isinstance(child, DiscoverDatasets)\n-        )\n+        return isinstance(child, OutputFilter) or isinstance(child, ChangeFormat) or isinstance(child, DiscoverDatasets)\n \n \n class OutputFilter(XMLParam):\n@@ -713,25 +650,19 @@\n         type_source=None,\n         structured_like=None,\n         inherit_format=None,\n-        **kwargs,\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 (\n-            isinstance(child, OutputData)\n-            or isinstance(child, OutputFilter)\n-            or isinstance(child, DiscoverDatasets)\n-        )\n+        return isinstance(child, OutputData) or isinstance(child, OutputFilter) or isinstance(child, DiscoverDatasets)\n \n \n class DiscoverDatasets(XMLParam):\n     name = "discover_datasets"\n \n-    def __init__(\n-        self, pattern, directory=None, format=None, ext=None, visible=None, **kwargs\n-    ):\n+    def __init__(self, pattern, directory=None, format=None, ext=None, visible=None, **kwargs):\n         params = Util.clean_kwargs(locals().copy())\n         super(DiscoverDatasets, self).__init__(**params)\n \n@@ -773,7 +704,7 @@\n         compare=None,\n         lines_diff=None,\n         delta=None,\n-        **kwargs,\n+        **kwargs\n     ):\n         params = Util.clean_kwargs(locals().copy())\n         super(TestOutput, self).__init__(**params)\n'
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/galaxyxml/tool/parameters/__pycache__/__init__.cpython-36.pyc
b
Binary file toolfactory/galaxyxml/tool/parameters/__pycache__/__init__.cpython-36.pyc has changed
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/rgToolFactory2.py
--- a/toolfactory/rgToolFactory2.py Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/rgToolFactory2.py Wed Aug 12 01:43:46 2020 -0400
[
b'@@ -1,3 +1,4 @@\n+#!/usr/bin/env python\n # rgToolFactory.py\n # see https://github.com/fubar2/toolfactory\n #\n@@ -33,40 +34,45 @@\n \n import galaxyxml.tool as gxt\n import galaxyxml.tool.parameters as gxtp\n+\n import lxml\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 verbose = True\n debug = True\n toolFactoryURL = "https://github.com/fubar2/toolfactory"\n ourdelim = "~~~"\n \n-# --input_files="$input_files~~~$CL~~~$input_formats~~~$input_label~~~$input_help"\n+# --input_files="$input_files~~~$CL~~~$input_formats~~~$input_label\n+# ~~~$input_help"\n IPATHPOS = 0\n ICLPOS = 1\n IFMTPOS = 2\n ILABPOS = 3\n IHELPOS = 4\n IOCLPOS = 5\n+\n # --output_files "$otab.history_name~~~$otab.history_format~~~$otab.CL\n ONAMEPOS = 0\n OFMTPOS = 1\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~~~\n+# $i.param_label~~~$i.param_help~~~$i.param_type~~~$i.CL~~~i$.param_CLoverride"\n ANAMEPOS = 0\n AVALPOS = 1\n ALABPOS = 2\n AHELPPOS = 3\n ATYPEPOS = 4\n ACLPOS = 5\n-AOCLPOS = 6\n+AOVERPOS = 6\n+AOCLPOS = 7\n \n \n+foo = len(lxml.__version__)\n+# fug you, flake8. Say my name!\n+\n def timenow():\n     """return current time as a string\n     """\n@@ -108,9 +114,11 @@\n     citation_tuples = []\n     for citation in citations:\n         if citation.startswith("doi"):\n-            citation_tuples.append(("doi", citation[len("doi"):].strip()))\n+            citation_tuples.append(("doi", citation[len("doi") :].strip()))\n         else:\n-            citation_tuples.append(("bibtex", citation[len("bibtex"):].strip()))\n+            citation_tuples.append(\n+                ("bibtex", citation[len("bibtex") :].strip())\n+            )\n     return citation_tuples\n \n \n@@ -144,7 +152,6 @@\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.interpreter_name:\n             exe = "$runMe"\n         else:\n@@ -177,25 +184,41 @@\n             clsuffix = []\n             xclsuffix = []\n             for i, p in enumerate(self.infiles):\n-                appendme = [p[IOCLPOS], p[ICLPOS], p[IPATHPOS]]\n+                if p[IOCLPOS] == "STDIN":\n+                    appendme = [\n+                        p[IOCLPOS],\n+                        p[ICLPOS],\n+                        p[IPATHPOS],\n+                        "< %s" % p[IPATHPOS],\n+                    ]\n+                    xappendme = [\n+                        p[IOCLPOS],\n+                        p[ICLPOS],\n+                        p[IPATHPOS],\n+                        "< $%s" % p[ICLPOS],\n+                    ]\n+                else:\n+                    appendme = [p[IOCLPOS], p[ICLPOS], p[IPATHPOS], ""]\n+                    xappendme = [p[IOCLPOS], p[ICLPOS], "$%s" % p[ICLPOS], ""]\n                 clsuffix.append(appendme)\n-                xclsuffix.append([p[IOCLPOS], p[ICLPOS], "$%s" % p[ICLPOS]])\n+                xclsuffix.append(xappendme)\n                 # print(\'##infile i=%d, appendme=%s\' % (i,appendme))\n             for i, p in enumerate(self.outfiles):\n                 if p[OOCLPOS] == "STDOUT":\n                     self.lastclredirect = [">", p[ONAMEPOS]]\n                     self.lastxclredirect = [">", "$%s" % p[OCLPOS]]\n-                    # print(\'##outfiles i=%d lastclredirect = %s\' % (i,self.lastclredirect))\n                 else:\n-                    appendme = [p[OOCLPOS], p[OCLPOS], p[ONAMEPOS]]\n-                    clsuffix.append(appendme)\n-                    xclsuffix.append([p[OOCLPOS], p[OCLPOS], "$%s" % p[ONAMEPOS]])\n-                    # print(\'##outfiles i=%d\' % i,\'appendme\',appendme)\n+                    clsuffix.append([p[OOCLPOS], p[OCLPOS], p['..b'  "## Run failed. Cannot build yet. Please fix and retry"\n+            )\n             sys.exit(1)\n         tdir = "tfout"\n         if not os.path.exists(tdir):\n@@ -549,19 +590,32 @@\n                 shutil.copyfile(pth, dest)\n \n         if os.path.exists(self.tlog) and os.stat(self.tlog).st_size > 0:\n-            shutil.copyfile(self.tlog, os.path.join(testdir, "test1_log.txt"))\n+            shutil.copyfile(self.tlog, os.path.join(testdir, "test1_log_outfiletxt"))\n         if self.args.runmode not in ["Executable", "system"]:\n             stname = os.path.join(tdir, "%s" % (self.sfile))\n             if not os.path.exists(stname):\n                 shutil.copyfile(self.sfile, stname)\n-        xtname = os.path.join(tdir, self.xmlfile)\n-        if not os.path.exists(xtname):\n-            shutil.copyfile(self.xmlfile, xtname)\n+        xreal = \'%s.xml\' % self.tool_name\n+        xout = os.path.join(tdir,xreal)\n+        shutil.copyfile(xreal, xout)\n         tarpath = "toolfactory_%s.tgz" % self.tool_name\n         tf = tarfile.open(tarpath, "w:gz")\n         tf.add(name=tdir, arcname=self.tool_name)\n         tf.close()\n         shutil.copyfile(tarpath, self.args.new_tool)\n+        shutil.copyfile(xreal,"tool_xml.txt")\n+        repdir = "TF_run_report_tempdir"\n+        if not os.path.exists(repdir):\n+            os.mkdir(repdir)\n+        repoutnames = [x[OCLPOS] for x in self.outfiles]\n+        with os.scandir(\'.\') as outs:\n+            for entry in outs:\n+                if entry.name.endswith(\'.tgz\') or not entry.is_file():\n+                    continue\n+                if entry.name in repoutnames:\n+                    shutil.copyfile(entry.name,os.path.join(repdir,entry.name))\n+                elif entry.name == "%s.xml" % self.tool_name:\n+                    shutil.copyfile(entry.name,os.path.join(repdir,"new_tool_xml"))\n         return retval\n \n     def run(self):\n@@ -577,12 +631,15 @@\n         if self.args.parampass != "0":\n             ste = open(self.elog, "wb")\n             if self.lastclredirect:\n-                sto = open(self.lastclredirect[1], "wb")  # is name of an output file\n+                sto = open(\n+                    self.lastclredirect[1], "wb"\n+                )  # is name of an output file\n             else:\n                 sto = open(self.tlog, "wb")\n                 sto.write(\n                     bytes(\n-                        "## Executing Toolfactory generated command line = %s\\n" % scl,\n+                        "## Executing Toolfactory generated command line = %s\\n"\n+                        % scl,\n                         "utf8",\n                     )\n                 )\n@@ -654,17 +711,23 @@\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.tool_name\n+    ), "## 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+    args.input_files = [\n+        x.replace(\'"\', "").replace("\'", "") for x in args.input_files\n+    ]\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+        args.additional_parameters[i] = args.additional_parameters[i].replace(\n+            \'"\', ""\n+        )\n     r = ScriptRunner(args)\n     if args.make_Tool:\n         retcode = r.makeTooltar()\n'
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/rgToolFactory2.xml
--- a/toolfactory/rgToolFactory2.xml Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/rgToolFactory2.xml Wed Aug 12 01:43:46 2020 -0400
[
b'@@ -1,10 +1,10 @@\n-<tool id="rgTF2" name="toolfactory" version="2.00">\n+<tool id="rgTF2" name="toolfactory" version="2.00" profile="16.04" >\n   <description>Scripts into tools</description>\n   <macros>\n      <xml name="io">\n         <repeat name="history_inputs" title="Add a data file from your history to pass in to the script. Use the \'+\' button as needed"\n              help="USE SMALL SAMPLES because these will be used for the new tool\'s test. The names will become a history item selector as input for users of the new tool you are making">\n-            <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" size="120" multiple="false"\n+            <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" multiple="false"\n                help=""/>\n             <param name="input_formats" type="select" multiple="true" label="Select the datatype(s) that your tool/script accepts as input"\n               help="If your datatype is not listed here, it has to be added in galaxy\'s datatypes_conf.xml" value="tabular">\n@@ -12,7 +12,7 @@\n                 <column name="value" index="0"/>\n                </options>\n             </param>\n-            <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative" size="60" \n+            <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative"\n              help="Note that \'~~~\' is an internal delimiter so must not appear in this text field - please work around this technical limitation" >\n             <sanitizer invalid_char="">\n               <valid initial="string.printable"> <remove value=\'~~~\'/> </valid>\n@@ -20,33 +20,31 @@\n             </sanitizer>\n             </param>\n             <param name="input_help" type="text" value="parameter_help" label="This will become help text on the form."\n-             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation" size="60">\n+             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation">\n             <sanitizer invalid_char="">\n               <valid initial="string.printable"> <remove value=\'~~~\'/> </valid>\n               <mapping initial="none"/>\n             </sanitizer>\n             </param>\n-            <param name="input_CL" type="text" size="60" label="Positional: ordinal integer. Argparse: argument name."\n-              help="If you will pass positional parameters, enter the integer ordinal for this parameter. If Argparse style, \'--\' will be prepended or \'-\' if single character" value="">          \n+            <param name="input_CL" type="text" label="Positional: ordinal integer. Argparse: argument name. STDIN if the executable/script expects it"\n+              help="If you will pass positional parameters, enter the integer ordinal for this parameter. If Argparse style, \'--\' will be prepended or \'-\' if single character" value="">\n             </param>\n         </repeat>\n         <repeat name="history_outputs" title="Add a tool run output file to the user\'s history from your tool - Use the \'+\' button to add as many as needed"\n              help="The name will become a history item for users of the new tool you are making containing one of it\'s outputs">\n-            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" size="120" \n-               help=""/>\n+            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" help=""/>\n             <param name="history_format" type="select" multiple="false" label="Select the datatype for this output"\n               help="If your datatype is not listed here, it has to be added in galaxy\'s datatypes'..b'cited when this tool is used in published research." />\n                     </when>\n                     <when value="bibtex">\n-                        <param name="bibtex" label="BibTex" type="text" area="true" size="8x120"\n+                        <param name="bibtex" label="BibTex" type="text" area="true"\n                             help="Supply a BibTex entry that should be cited when this tool is used in published research." value="" >\n                             <sanitizer>\n                                 <valid initial="string.printable">\n@@ -315,15 +314,19 @@\n         </when>\n         <when value = "">\n         </when>\n-    </conditional> \n+    </conditional>\n   </inputs>\n   <outputs>\n-    <collection name="ToolFactory_Outputs" type="list" label="Toolfactory ${tool_name} test run outputs" >\n-       <discover_datasets pattern="__name__" directory="tfout/test-data" format="txt"/>\n-    </collection>\n-    <data format="tgz" name="new_tool" label="${tool_name}_toolshed.tgz">\n+\n+    <data format="tgz" name="new_tool" label="${tool_name}_toolshed.tgz" >\n         <filter>makeMode[\'make_Tool\'] == "yes"</filter>\n     </data>\n+\n+  <collection name="TF_run_report" type="list" label="${tool_name} outputs">\n+      <discover_datasets pattern="__name__" directory="TF_run_report_tempdir" format="txt"/>\n+  </collection>\n+\n+\n   </outputs>\n <tests>\n <test>\n@@ -342,27 +345,25 @@\n     <param name="history_name" value="output2_sample" />\n     <param name="history_format" value="txt" />\n     <param name="history_CL" value="2" />\n-    <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,\'r\').readlines(); o = open(outp,\'w\'); rs = [\'\'.join(list(reversed(x.rstrip()))) for x in inlist]; o.write(\'\\n\'.join(rs)); o.close()"/> \n-    <output_collection name="ToolFactory_Outputs" type="list">\n-        <element name="output2_sample_sample" file="output2_sample" ftype="txt" compare="diff" lines_diff = "10" />\n-    </output_collection>\n+    <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,\'r\').readlines(); o = open(outp,\'w\'); rs = [\'\'.join(list(reversed(x.rstrip()))) for x in inlist]; o.write(\'\\n\'.join(rs)); o.close()"/>\n     <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" />\n+    <!-- <output name="output" file="output2_sample" ftype="txt" compare="diff" lines_diff = "10" /> -->\n </test>\n </tests>\n <help>\n \n .. class:: warningmark\n \n-**Details and attribution** \n+**Details and attribution**\n (see GTF_)\n \n-**Local Admins ONLY** \n+**Local Admins ONLY**\n Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.\n \n-**If you find a bug** \n+**If you find a bug**\n Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_\n \n-**What it does** \n+**What it does**\n This tool optionally generates normal workflow compatible first class Galaxy tools\n \n Generated tools can run existing binary packages that become requirements, existing scripts, or new scripts pasted into this tool form.\n@@ -382,7 +383,7 @@\n \n .. class:: warningmark\n \n-**Note to system administrators** \n+**Note to system administrators**\n This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.\n Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.\n \n@@ -412,7 +413,7 @@\n     o.close()\n \n With argparse style parameters:\n-    \n+\n ::\n \n     # reverse order of text by row\n@@ -433,7 +434,7 @@\n       o.write(\'\'.join(rs))\n       o.write(\'\\n\')\n     o.close()\n-     \n+\n \n Paper_ :\n \n@@ -441,7 +442,7 @@\n Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team\n Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573\n \n-**Licensing** \n+**Licensing**\n \n Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012\n All rights reserved.\n'
b
diff -r 099047ee7094 -r a30536c100bf toolfactory/testtf.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/testtf.sh Wed Aug 12 01:43:46 2020 -0400
b
@@ -0,0 +1,2 @@
+planemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/toolfactory &>foo
+