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

Changeset 48:5a7a5b06bce0 (2020-08-23)
Previous changeset 47:e95d9fe5ab50 (2020-08-23) Next changeset 49:35a912ce0c83 (2020-08-27)
Commit message:
Uploaded
added:
toolfactory/.shed.yml
toolfactory/LICENSE
toolfactory/README.md
toolfactory/images/dynamicScriptTool.png
toolfactory/rgToolFactory2.py
toolfactory/rgToolFactory2.xml
toolfactory/test-data/input1_sample
toolfactory/test-data/output2_sample
toolfactory/test-data/pyrevpos.python
toolfactory/test-data/test1_log.txt
toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
removed:
home/ross/galaxy/tools/tool_makers/toolfactory/.shed.yml
home/ross/galaxy/tools/tool_makers/toolfactory/LICENSE
home/ross/galaxy/tools/tool_makers/toolfactory/README.md
home/ross/galaxy/tools/tool_makers/toolfactory/images/dynamicScriptTool.png
home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.py
home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.xml
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/input1_sample
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/output2_sample
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/pyrevpos.python
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/test1_log.txt
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/.shed.yml
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/.shed.yml Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,13 +0,0 @@
-name: toolfactory
-owner: fubar
-description: ToolFactory - tool to make Galaxy tools ready for the toolshed
-homepage_url: https://github.com/fubar2/toolfactory
-long_description: |
-    ToolFactory - turn executable packages and R/python/perl/bash scripts into ordinary Galaxy tools
-
-    Creating re-usable tools from scripts: The Galaxy Tool Factory Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team 
-    Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
-remote_repository_url: https://github.com/fubar2/toolfactory
-type: tool_dependency_definition
-categories:
-- Tool Generators
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/LICENSE
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/LICENSE Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
b"@@ -1,504 +0,0 @@\n-GNU LESSER GENERAL PUBLIC LICENSE\n-                       Version 2.1, February 1999\n-\n- Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n- Everyone is permitted to copy and distribute verbatim copies\n- of this license document, but changing it is not allowed.\n-\n-(This is the first released version of the Lesser GPL.  It also counts\n- as the successor of the GNU Library Public License, version 2, hence\n- the version number 2.1.)\n-\n-                            Preamble\n-\n-  The licenses for most software are designed to take away your\n-freedom to share and change it.  By contrast, the GNU General Public\n-Licenses are intended to guarantee your freedom to share and change\n-free software--to make sure the software is free for all its users.\n-\n-  This license, the Lesser General Public License, applies to some\n-specially designated software packages--typically libraries--of the\n-Free Software Foundation and other authors who decide to use it.  You\n-can use it too, but we suggest you first think carefully about whether\n-this license or the ordinary General Public License is the better\n-strategy to use in any particular case, based on the explanations below.\n-\n-  When we speak of free software, we are referring to freedom of use,\n-not price.  Our General Public Licenses are designed to make sure that\n-you have the freedom to distribute copies of free software (and charge\n-for this service if you wish); that you receive source code or can get\n-it if you want it; that you can change the software and use pieces of\n-it in new free programs; and that you are informed that you can do\n-these things.\n-\n-  To protect your rights, we need to make restrictions that forbid\n-distributors to deny you these rights or to ask you to surrender these\n-rights.  These restrictions translate to certain responsibilities for\n-you if you distribute copies of the library or if you modify it.\n-\n-  For example, if you distribute copies of the library, whether gratis\n-or for a fee, you must give the recipients all the rights that we gave\n-you.  You must make sure that they, too, receive or can get the source\n-code.  If you link other code with the library, you must provide\n-complete object files to the recipients, so that they can relink them\n-with the library after making changes to the library and recompiling\n-it.  And you must show them these terms so they know their rights.\n-\n-  We protect your rights with a two-step method: (1) we copyright the\n-library, and (2) we offer you this license, which gives you legal\n-permission to copy, distribute and/or modify the library.\n-\n-  To protect each distributor, we want to make it very clear that\n-there is no warranty for the free library.  Also, if the library is\n-modified by someone else and passed on, the recipients should know\n-that what they have is not the original version, so that the original\n-author's reputation will not be affected by problems that might be\n-introduced by others.\n-\n-  Finally, software patents pose a constant threat to the existence of\n-any free program.  We wish to make sure that a company cannot\n-effectively restrict the users of a free program by obtaining a\n-restrictive license from a patent holder.  Therefore, we insist that\n-any patent license obtained for a version of the library must be\n-consistent with the full freedom of use specified in this license.\n-\n-  Most GNU software, including some libraries, is covered by the\n-ordinary GNU General Public License.  This license, the GNU Lesser\n-General Public License, applies to certain designated libraries, and\n-is quite different from the ordinary General Public License.  We use\n-this license for certain libraries in order to permit linking those\n-libraries into non-free programs.\n-\n-  When a program is linked with a library, whether statically or using\n-a shared library, the combination of the two is legally speaking a\n-combined work, a derivative "..b'oes not specify a\n-license version number, you may choose any version ever published by\n-the Free Software Foundation.\n-\n-  14. If you wish to incorporate parts of the Library into other free\n-programs whose distribution conditions are incompatible with these,\n-write to the author to ask for permission.  For software which is\n-copyrighted by the Free Software Foundation, write to the Free\n-Software Foundation; we sometimes make exceptions for this.  Our\n-decision will be guided by the two goals of preserving the free status\n-of all derivatives of our free software and of promoting the sharing\n-and reuse of software generally.\n-\n-                            NO WARRANTY\n-\n-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\n-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\n-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\n-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\n-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\n-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n-\n-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\n-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\n-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\n-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\n-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\n-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\n-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\n-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n-DAMAGES.\n-\n-                     END OF TERMS AND CONDITIONS\n-\n-           How to Apply These Terms to Your New Libraries\n-\n-  If you develop a new library, and you want it to be of the greatest\n-possible use to the public, we recommend making it free software that\n-everyone can redistribute and change.  You can do so by permitting\n-redistribution under these terms (or, alternatively, under the terms of the\n-ordinary General Public License).\n-\n-  To apply these terms, attach the following notices to the library.  It is\n-safest to attach them to the start of each source file to most effectively\n-convey the exclusion of warranty; and each file should have at least the\n-"copyright" line and a pointer to where the full notice is found.\n-\n-    {description}\n-    Copyright (C) {year} {fullname}\n-\n-    This library is free software; you can redistribute it and/or\n-    modify it under the terms of the GNU Lesser General Public\n-    License as published by the Free Software Foundation; either\n-    version 2.1 of the License, or (at your option) any later version.\n-\n-    This library is distributed in the hope that it will be useful,\n-    but WITHOUT ANY WARRANTY; without even the implied warranty of\n-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n-    Lesser General Public License for more details.\n-\n-    You should have received a copy of the GNU Lesser General Public\n-    License along with this library; if not, write to the Free Software\n-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n-    USA\n-\n-Also add information on how to contact you by electronic and paper mail.\n-\n-You should also get your employer (if you work as a programmer) or your\n-school, if any, to sign a "copyright disclaimer" for the library, if\n-necessary.  Here is a sample; alter the names:\n-\n-  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n-  library `Frob\' (a library for tweaking knobs) written by James Random\n-  Hacker.\n-\n-  {signature of Ty Coon}, 1 April 1990\n-  Ty Coon, President of Vice\n-\n-That\'s all there is to it!\n'
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/README.md
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/README.md Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,166 +0,0 @@
-*WARNING before you start*
-
- Install this tool on a private Galaxy ONLY
- Please NEVER on a public or production instance

-Updated august 2014 by John Chilton adding citation support
-
-Updated august 8 2014 to fix bugs reported by Marius van den Beek
-
-Please cite the resource at
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-if you use this tool in your published work.
-
-**Short Story**
-
-This is an unusual Galaxy tool capable of generating new Galaxy tools.
-It works by exposing *unrestricted* and therefore extremely dangerous scripting
-to all designated administrators of the host Galaxy server, allowing them to
-run scripts in R, python, sh and perl over multiple selected input data sets,
-writing a single new data set as output.
-
-*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
-
-It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
-
-
-**Automated generation of new Galaxy tools for installation into any Galaxy**
-
-A test is generated using small sample test data inputs and parameter settings you supply.
-Once the test case outputs have been produced, they can be used to build a
-new Galaxy tool. The supplied script or executable is baked as a requirement
-into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
-Generated tools are installed via a tool shed by an administrator
-and work exactly like all other Galaxy tools for your users.
-
-**More Detail**
-
-To use the ToolFactory, you should have prepared a script to paste into a
-text box, or have a package in mind and a small test input example ready to select from your history
-to test your new script.
-
-```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
-
-There is an example in each scripting language on the Tool Factory form. You
-can just cut and paste these to try it out - remember to select the right
-interpreter please. You'll also need to create a small test data set using
-the Galaxy history add new data tool.
-
-If the script fails somehow, use the "redo" button on the tool output in
-your history to recreate the form complete with broken script. Fix the bug
-and execute again. Rinse, wash, repeat.
-
-Once the script runs sucessfully, a new Galaxy tool that runs your script
-can be generated. Select the "generate" option and supply some help text and
-names. The new tool will be generated in the form of a new Galaxy datatype
-*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
-Galaxy ToolShed as a new tool repository.
-
-Once it's in a ToolShed, it can be installed into any local Galaxy server
-from the server administrative interface.
-
-Once the new tool is installed, local users can run it - each time, the script
-that was supplied when it was built will be executed with the input chosen
-from the user's history. In other words, the tools you generate with the
-ToolFactory run just like any other Galaxy tool,but run your script every time.
-
-Tool factory tools are perfect for workflow components. One input, one output,
-no variables.
-
-*To fully and safely exploit the awesome power* of this tool,
-Galaxy and the ToolShed, you should be a developer installing this
-tool on a private/personal/scratch local instance where you are an
-admin_user. Then, if you break it, you get to keep all the pieces see
-https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
-
-**Installation**
-This is a Galaxy tool. You can install it most conveniently using the
-administrative "Search and browse tool sheds" link. Find the Galaxy Main
-toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
-repository. Open it and review the code and select the option to install it.
-
-If you can't get the tool that way, the xml and py files here need to be
-copied into a new tools
-subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
-pointing to the xml
-file - something like::
-
-  <section name="Tool building tools" id="toolbuilders">
-    <tool file="toolfactory/rgToolFactory.xml"/>
-  </section>
-
-If not already there,
-please add:
-<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
-mimetype="multipart/x-gzip" subclass="True" />
-to your local data_types_conf.xml.
-
-
-**Restricted execution**
-
-The tool factory tool itself will then be usable ONLY by admin users -
-people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
-admin_users can run this tool** Think about it for a moment. If allowed to
-run any arbitrary script on your Galaxy server, the only thing that would
-impede a miscreant bent on destroying all your Galaxy data would probably
-be lack of appropriate technical skills.
-
-**What it does** 
-
-This is a tool factory for simple scripts in python, R and
-perl currently. Functional tests are automatically generated. How cool is that.
-
-LIMITED to simple scripts that read one input from the history. Optionally can
-write one new history dataset, and optionally collect any number of outputs
-into links on an autogenerated HTML index page for the user to navigate -
-useful if the script writes images and output files - pdf outputs are shown
-as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
-imagemagik need to be available.
-
-Generated tools can be edited and enhanced like any Galaxy tool, so start
-small and build up since a generated script gets you a serious leg up to a
-more complex one.
-
-**What you do**
-
-You paste and run your script, you fix the syntax errors and
-eventually it runs. You can use the redo button and edit the script before
-trying to rerun it as you debug - it works pretty well.
-
-Once the script works on some test data, you can generate a toolshed compatible
-gzip file containing your script ready to run as an ordinary Galaxy tool in
-a repository on your local toolshed. That means safe and largely automated
-installation in any production Galaxy configured to use your toolshed.
-
-**Generated tool Security**
-
-Once you install a generated tool, it's just
-another tool - assuming the script is safe. They just run normally and their
-user cannot do anything unusually insecure but please, practice safe toolshed.
-Read the code before you install any tool. Especially this one - it is really scary.
-
-**Send Code**
-
-Patches and suggestions welcome as bitbucket issues please?
-
-**Attribution**
-
-Creating re-usable tools from scripts: The Galaxy Tool Factory
-Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
-Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
-
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-
-**Licensing**
-
-Copyright Ross Lazarus 2010
-ross lazarus at g mail period com
-
-All rights reserved.
-
-Licensed under the LGPL
-
-**Obligatory screenshot**
-
-http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
-
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/images/dynamicScriptTool.png
b
Binary file home/ross/galaxy/tools/tool_makers/toolfactory/images/dynamicScriptTool.png has changed
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.py
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.py Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,843 +0,0 @@\n-#!/usr/bin/env python\n-# rgToolFactory.py\n-# see https://github.com/fubar2/toolfactory\n-#\n-# copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012\n-#\n-# all rights reserved\n-# Licensed under the LGPL\n-# suggestions for improvement and bug fixes welcome at https://github.com/fubar2/toolfactory\n-#\n-# July 2020: BCC was fun and I feel like rip van winkle after 5 years.\n-# Decided to\n-# 1. Fix the toolfactory so it works - done for simplest case\n-# 2. Fix planemo so the toolfactory function works\n-# 3. Rewrite bits using galaxyxml functions where that makes sense - done\n-#\n-# removed all the old complications including making the new tool use this same script\n-# galaxyxml now generates the tool xml https://github.com/hexylena/galaxyxml\n-# No support for automatic HTML file creation from arbitrary outputs\n-# essential problem is to create two command lines - one for the tool xml and a different\n-# one to run the executable with the supplied test data and settings\n-# Be simpler to write the tool, then run it with planemo and soak up the test outputs.\n-\n-\n-\n-import argparse\n-import logging\n-import os\n-import re\n-import shutil\n-import subprocess\n-import sys\n-import tarfile\n-import tempfile\n-import time\n-\n-import galaxyxml.tool as gxt\n-import galaxyxml.tool.parameters as gxtp\n-\n-import lxml\n-\n-import yaml\n-\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\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~~~\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-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-    return time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(time.time()))\n-\n-\n-def quote_non_numeric(s):\n-    """return a prequoted string for non-numerics\n-    useful for perl and Rscript parameter passing?\n-    """\n-    try:\n-        _ = float(s)\n-        return s\n-    except ValueError:\n-        return \'"%s"\' % s\n-\n-\n-html_escape_table = {"&": "&amp;", ">": "&gt;", "<": "&lt;", "$": r"\\$"}\n-\n-\n-def html_escape(text):\n-    """Produce entities within text."""\n-    return "".join(html_escape_table.get(c, c) for c in text)\n-\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-    return t\n-\n-\n-def parse_citations(citations_text):\n-    """\n-    """\n-    citations = [c for c in citations_text.split("**ENTRY**") if c.strip()]\n-    citation_tuples = []\n-    for citation in citations:\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-            )\n-    return citation_tuples\n-\n-\n-class ScriptRunner:\n-    """Wrapper for an arbitrary script\n-    uses galaxyxml\n-\n-    """\n-\n-    def __init__(self, args=None):\n-        """\n-        prepare command line cl for running the tool here\n-        and prepare elements needed for galaxyxml tool generation\n-        """\n-\n-        self.infiles = [x.split(ourdelim) for x in args.input_files]\n-        self.outfiles = [x.split(ourdelim) for x in args.output_files]\n-        self.addpar = [x.split(ourdelim) for x in args.additional_parameters]\n-        self.args = args\n-        self.cleanuppar()\n-        s'..b'elf):\n-        """\n-        """\n-        cll = [\'shed-tools\', \'install\', \'-g\', self.args.galaxy_url, \'--latest\',\n-           \'-a\', self.args.galaxy_api_key , \'--name\', self.args.tool_name, \'--owner\',\'fubar\',\n-           \'--toolshed\', self.args.toolshed_url,\n-           \'--section_label\',\'Generated Tools\',\'--install_tool_dependencies\',]\n-        print(\'running\\n\',\' \'.join(cll))\n-        p = subprocess.run(cll, shell=False)\n-        if p.returncode != 0:\n-            print(\'Repository %s installation returned %d\' % (self.args.tool_name,p.retcode))\n-        else:\n-            print(\'installed %s\' % self.args.tool_name)\n-        return p.returncode\n-\n-    def writeShedyml(self):\n-        yuser = self.args.user_email.split(\'@\')[0]\n-        yfname = os.path.join(self.tooloutdir,\'.shed.yml\')\n-        yamlf = open(yfname, \'w\')\n-        odict = {\'name\':self.tool_name,\'owner\':yuser,\'type\':\'unrestricted\',\'description\':self.args.tool_desc}\n-        yaml.dump(odict, yamlf, allow_unicode=True)\n-        yamlf.close()\n-\n-def main():\n-    """\n-    This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as:\n-    <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" --tool_name "foo" --interpreter "Rscript"\n-    </command>\n-    """\n-    parser = argparse.ArgumentParser()\n-    a = parser.add_argument\n-    a("--script_path", default="")\n-    a("--dependencies", default="")\n-    a("--cl_override", 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("--galaxy_url", default="http://localhost")\n-    a("--galaxy_api_key", default=\'fakekey\')\n-    a("--toolshed_url", default="http://localhost:9009")\n-    a("--toolshed_api_key", default=None)\n-    a("--planemo_test", default="yes")\n-\n-    args = parser.parse_args()\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 (\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 = [\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-            \'"\', ""\n-        )\n-    r = ScriptRunner(args)\n-    if args.make_Tool:\n-        r.writeShedyml()\n-        retcode = r.makeTooltar()\n-        if retcode == 0:\n-            if args.planemo_test == "yes":\n-                r.install_load()\n-    else:\n-        retcode = r.run()\n-    # if retcode:\n-        # sys.exit(retcode)  # indicate failure to job runner\n-\n-\n-if __name__ == "__main__":\n-    main()\n'
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.xml
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.xml Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,476 +0,0 @@\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" 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-               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\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"\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-              <mapping initial="none"/>\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">\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" 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" 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_conf.xml" value="tabular">\n-               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\n-                <column name="value" index="0"/>\n-               </options>\n-            </param>\n-            <param name="history_CL" type="text"  label="Positional: ordinal integer. Argparse: argument name expected for this output parameter. Use STDOUT if \'>\' required."\n-              help="If positional parameters, enter the integer ordinal expected for this parameter. If Argparse style, \'--\' will be prepended or \'-\' if single character" value=""/>\n-        </repeat>\n-     </xml>\n-     <xml name="additparam">\n-        <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?"\n-             help="If no (default), users will NOT be able to alter any additional parameters.'..b'); 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-(see GTF_)\n-\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-Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_\n-\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-Pasted scripts are written so they are part of the new tool and cannot be adjusted by the downstream user.\n-Binary packages are managed by the dependency subsystem - conda usually, so anything in bioconda or conda_forge is available for example.\n-\n-Any number of parameters can be built into the new tool form for passing in to the script or executable at runtime.\n-These can be editable by the downstream user or baked in.\n-\n-When you run this tool, your executable or script and supplied parameter values will be run to produce a canonical\n-set of outputs - these are used to construct a test for the new tool.\n-\n-If tool generation is required, a new tarball compatible with any Galaxy toolshed is created.\n-It can be unpacked in your galaxy/tools directory and manually added to tool_conf.xml, or\n-installed into any toolshed from where it can be installed into your Galaxy.\n-\n-\n-.. class:: warningmark\n-\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-.. class:: warningmark\n-\n-**Use on public servers**  is STRONGLY discouraged for obvious reasons\n-\n-The tools generated by this tool will run just as securely as any other normal installed Galaxy tool but like any other new tools, should always be checked carefully before installation.\n-We recommend that you follow the good code hygiene practices associated with safe toolshed practices.\n-\n-Here\'s a sample python script that can be cut and pasted into the tool form, suitable for positional parameter passing:\n-\n-::\n-\n-    # reverse order of text by row\n-    import sys\n-    inp = sys.argv[1]\n-    outp = sys.argv[2]\n-    i = open(inp,\'r\').readlines()\n-    o = open(outp,\'w\')\n-    for row in i:\n-      rs = row.rstrip()\n-      rs = list(rs)\n-      rs.reverse()\n-      o.write(\'\'.join(rs))\n-      o.write(\'\\n\')\n-    o.close()\n-\n-With argparse style parameters:\n-\n-::\n-\n-    # reverse order of text by row\n-    import argparse\n-    parser = argparse.ArgumentParser()\n-    a = parser.add_argument\n-    a(\'--infile\',default=\'\')\n-    a(\'--outfile\',default=None)\n-    args = parser.parse_args()\n-    inp = args.infile\n-    outp = args.outfile\n-    i = open(inp,\'r\').readlines()\n-    o = open(outp,\'w\')\n-    for row in i:\n-      rs = row.rstrip()\n-      rs = list(rs)\n-      rs.reverse()\n-      o.write(\'\'.join(rs))\n-      o.write(\'\\n\')\n-    o.close()\n-\n-\n-Paper_ :\n-\n-Creating re-usable tools from scripts: The Galaxy Tool Factory\n-Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team\n-Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573\n-\n-**Licensing**\n-\n-Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012\n-All rights reserved.\n-Licensed under the LGPL_\n-\n-.. _LGPL: http://www.gnu.org/copyleft/lesser.html\n-.. _GTF:  https://github.com/fubar2/toolfactory\n-.. _Paper: http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573\n-\n-\n-</help>\n-<citations>\n-    <citation type="doi">10.1093/bioinformatics/bts573</citation>\n-</citations>\n-</tool>\n-\n-\n'
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/input1_sample
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/input1_sample Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,166 +0,0 @@
-*WARNING before you start*
-
- Install this tool on a private Galaxy ONLY
- Please NEVER on a public or production instance

-Updated august 2014 by John Chilton adding citation support
-
-Updated august 8 2014 to fix bugs reported by Marius van den Beek
-
-Please cite the resource at
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-if you use this tool in your published work.
-
-**Short Story**
-
-This is an unusual Galaxy tool capable of generating new Galaxy tools.
-It works by exposing *unrestricted* and therefore extremely dangerous scripting
-to all designated administrators of the host Galaxy server, allowing them to
-run scripts in R, python, sh and perl over multiple selected input data sets,
-writing a single new data set as output.
-
-*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
-
-It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
-
-
-**Automated generation of new Galaxy tools for installation into any Galaxy**
-
-A test is generated using small sample test data inputs and parameter settings you supply.
-Once the test case outputs have been produced, they can be used to build a
-new Galaxy tool. The supplied script or executable is baked as a requirement
-into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
-Generated tools are installed via a tool shed by an administrator
-and work exactly like all other Galaxy tools for your users.
-
-**More Detail**
-
-To use the ToolFactory, you should have prepared a script to paste into a
-text box, or have a package in mind and a small test input example ready to select from your history
-to test your new script.
-
-```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
-
-There is an example in each scripting language on the Tool Factory form. You
-can just cut and paste these to try it out - remember to select the right
-interpreter please. You'll also need to create a small test data set using
-the Galaxy history add new data tool.
-
-If the script fails somehow, use the "redo" button on the tool output in
-your history to recreate the form complete with broken script. Fix the bug
-and execute again. Rinse, wash, repeat.
-
-Once the script runs sucessfully, a new Galaxy tool that runs your script
-can be generated. Select the "generate" option and supply some help text and
-names. The new tool will be generated in the form of a new Galaxy datatype
-*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
-Galaxy ToolShed as a new tool repository.
-
-Once it's in a ToolShed, it can be installed into any local Galaxy server
-from the server administrative interface.
-
-Once the new tool is installed, local users can run it - each time, the script
-that was supplied when it was built will be executed with the input chosen
-from the user's history. In other words, the tools you generate with the
-ToolFactory run just like any other Galaxy tool,but run your script every time.
-
-Tool factory tools are perfect for workflow components. One input, one output,
-no variables.
-
-*To fully and safely exploit the awesome power* of this tool,
-Galaxy and the ToolShed, you should be a developer installing this
-tool on a private/personal/scratch local instance where you are an
-admin_user. Then, if you break it, you get to keep all the pieces see
-https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
-
-**Installation**
-This is a Galaxy tool. You can install it most conveniently using the
-administrative "Search and browse tool sheds" link. Find the Galaxy Main
-toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
-repository. Open it and review the code and select the option to install it.
-
-If you can't get the tool that way, the xml and py files here need to be
-copied into a new tools
-subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
-pointing to the xml
-file - something like::
-
-  <section name="Tool building tools" id="toolbuilders">
-    <tool file="toolfactory/rgToolFactory.xml"/>
-  </section>
-
-If not already there,
-please add:
-<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
-mimetype="multipart/x-gzip" subclass="True" />
-to your local data_types_conf.xml.
-
-
-**Restricted execution**
-
-The tool factory tool itself will then be usable ONLY by admin users -
-people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
-admin_users can run this tool** Think about it for a moment. If allowed to
-run any arbitrary script on your Galaxy server, the only thing that would
-impede a miscreant bent on destroying all your Galaxy data would probably
-be lack of appropriate technical skills.
-
-**What it does** 
-
-This is a tool factory for simple scripts in python, R and
-perl currently. Functional tests are automatically generated. How cool is that.
-
-LIMITED to simple scripts that read one input from the history. Optionally can
-write one new history dataset, and optionally collect any number of outputs
-into links on an autogenerated HTML index page for the user to navigate -
-useful if the script writes images and output files - pdf outputs are shown
-as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
-imagemagik need to be available.
-
-Generated tools can be edited and enhanced like any Galaxy tool, so start
-small and build up since a generated script gets you a serious leg up to a
-more complex one.
-
-**What you do**
-
-You paste and run your script, you fix the syntax errors and
-eventually it runs. You can use the redo button and edit the script before
-trying to rerun it as you debug - it works pretty well.
-
-Once the script works on some test data, you can generate a toolshed compatible
-gzip file containing your script ready to run as an ordinary Galaxy tool in
-a repository on your local toolshed. That means safe and largely automated
-installation in any production Galaxy configured to use your toolshed.
-
-**Generated tool Security**
-
-Once you install a generated tool, it's just
-another tool - assuming the script is safe. They just run normally and their
-user cannot do anything unusually insecure but please, practice safe toolshed.
-Read the code before you install any tool. Especially this one - it is really scary.
-
-**Send Code**
-
-Patches and suggestions welcome as bitbucket issues please?
-
-**Attribution**
-
-Creating re-usable tools from scripts: The Galaxy Tool Factory
-Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
-Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
-
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-
-**Licensing**
-
-Copyright Ross Lazarus 2010
-ross lazarus at g mail period com
-
-All rights reserved.
-
-Licensed under the LGPL
-
-**Obligatory screenshot**
-
-http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
-
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/output2_sample
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/output2_sample Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,165 +0,0 @@
-*trats uoy erofeb GNINRAW*
-
-YLNO yxalaG etavirp a no loot siht llatsnI 
-ecnatsni noitcudorp ro cilbup a no REVEN esaelP 
-
-troppus noitatic gnidda notlihC nhoJ yb 4102 tsugua detadpU
-
-keeB ned nav suiraM yb detroper sgub xif ot 4102 8 tsugua detadpU
-
-ta ecruoser eht etic esaelP
-fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
-.krow dehsilbup ruoy ni loot siht esu uoy fi
-
-**yrotS trohS**
-
-.sloot yxalaG wen gnitareneg fo elbapac loot yxalaG lausunu na si sihT
-gnitpircs suoregnad ylemertxe erofereht dna *detcirtsernu* gnisopxe yb skrow tI
-ot meht gniwolla ,revres yxalaG tsoh eht fo srotartsinimda detangised lla ot
-,stes atad tupni detceles elpitlum revo lrep dna hs ,nohtyp ,R ni stpircs nur
-.tuptuo sa tes atad wen elgnis a gnitirw
-
-*sretemarap elyts esrapgra ro lanoitisop htiw elbatucexe yna ro tpircs hsab/lrep/nohtyp/r gnikrow a evah uoY*
-
-.loot yxalaG a gnisu ,setunim ni loot yxalaG yranidro na otni denrut eb nac tI
-
-
-**yxalaG yna otni noitallatsni rof sloot yxalaG wen fo noitareneg detamotuA**
-
-.ylppus uoy sgnittes retemarap dna stupni atad tset elpmas llams gnisu detareneg si tset A
-a dliub ot desu eb nac yeht ,decudorp neeb evah stuptuo esac tset eht ecnO
-tnemeriuqer a sa dekab si elbatucexe ro tpircs deilppus ehT .loot yxalaG wen
-.xob eht fo tuo elbitapmoc wolfkrow ylluf ,loot yxalaG yranidro ,wen a otni
-rotartsinimda na yb dehs loot a aiv dellatsni era sloot detareneG
-.sresu ruoy rof sloot yxalaG rehto lla ekil yltcaxe krow dna
-
-**liateD eroM**
-
-a otni etsap ot tpircs a deraperp evah dluohs uoy ,yrotcaFlooT eht esu oT
-yrotsih ruoy morf tceles ot ydaer elpmaxe tupni tset llams a dna dnim ni egakcap a evah ro ,xob txet
-.tpircs wen ruoy tset ot
-
-em rof skrow ```atad-tset/yrotcafloot/srekam_loot/sloot/yxalag/~ atad_tset-- yxalag/~ toor_yxalag-- lmx.2yrotcaFlooTgr tset omenalp```
-
-uoY .mrof yrotcaF looT eht no egaugnal gnitpircs hcae ni elpmaxe na si erehT
-thgir eht tceles ot rebmemer - tuo ti yrt ot eseht etsap dna tuc tsuj nac
-gnisu tes atad tset llams a etaerc ot deen osla ll'uoY .esaelp reterpretni
-.loot atad wen dda yrotsih yxalaG eht
-
-ni tuptuo loot eht no nottub "oder" eht esu ,wohemos sliaf tpircs eht fI
-gub eht xiF .tpircs nekorb htiw etelpmoc mrof eht etaercer ot yrotsih ruoy
-.taeper ,hsaw ,esniR .niaga etucexe dna
-
-tpircs ruoy snur taht loot yxalaG wen a ,yllufssecus snur tpircs eht ecnO
-dna txet pleh emos ylppus dna noitpo "etareneg" eht tceleS .detareneg eb nac
-epytatad yxalaG wen a fo mrof eht ni detareneg eb lliw loot wen ehT .seman
-a ot daolpu ot ydaer evihcra na s'ti ,stseggus eman eht sa - *zg.dehsloot*
-.yrotisoper loot wen a sa dehSlooT yxalaG
-
-revres yxalaG lacol yna otni dellatsni eb nac ti ,dehSlooT a ni s'ti ecnO
-.ecafretni evitartsinimda revres eht morf
-
-tpircs eht ,emit hcae - ti nur nac sresu lacol ,dellatsni si loot wen eht ecnO
-nesohc tupni eht htiw detucexe eb lliw tliub saw ti nehw deilppus saw taht
-eht htiw etareneg uoy sloot eht ,sdrow rehto nI .yrotsih s'resu eht morf
-.emit yreve tpircs ruoy nur tub,loot yxalaG rehto yna ekil tsuj nur yrotcaFlooT
-
-,tuptuo eno ,tupni enO .stnenopmoc wolfkrow rof tcefrep era sloot yrotcaf looT
-.selbairav on
-
-,loot siht fo *rewop emosewa eht tiolpxe ylefas dna ylluf oT*
-siht gnillatsni repoleved a eb dluohs uoy ,dehSlooT eht dna yxalaG
-na era uoy erehw ecnatsni lacol hctarcs/lanosrep/etavirp a no loot
-ees seceip eht lla peek ot teg uoy ,ti kaerb uoy fi ,nehT .resu_nimda
-emoH/ikiw/yrotcaflootyxalag/rabuf/gro.tekcubtib//:sptth
-
-**noitallatsnI**
-eht gnisu yltneinevnoc tsom ti llatsni nac uoY .loot yxalaG a si sihT
-niaM yxalaG eht dniF .knil "sdehs loot esworb dna hcraeS" evitartsinimda
-yrotcafloot eht rof hcraes dna /ude.usp.xb.2g.dehsloot//:sptth ta dehsloot
-.ti llatsni ot noitpo eht tceles dna edoc eht weiver dna ti nepO .yrotisoper
-
-eb ot deen ereh selif yp dna lmx eht ,yaw taht loot eht teg t'nac uoy fI
-sloot wen a otni deipoc
-yrtne wen a sdeen lmx.fnoc_loot ruoY yrotcafloot/sloot sa hcus yrotceridbus
-lmx eht ot gnitniop
-::ekil gnihtemos - elif
-
->"sredliubloot"=di "sloot gnidliub looT"=eman noitces<  
->/"lmx.yrotcaFlooTgr/yrotcafloot"=elif loot<    
->noitces/<  
-
-,ereht ydaerla ton fI
-:dda esaelp
-"yraniB:yranib.sepytatad.yxalag"=epyt "zg.dehsloot"=noisnetxe epytatad<
->/ "eurT"=ssalcbus "pizg-x/trapitlum"=epytemim
-.lmx.fnoc_sepyt_atad lacol ruoy ot
-
-
-**noitucexe detcirtseR**
-
-- sresu nimda yb YLNO elbasu eb neht lliw flesti loot yrotcaf loot ehT
-YLNO .thgir s'taht ,seY** ini.igsw_esrevinu ni sresu_nimda ni sDI htiw elpoep
-ot dewolla fI .tnemom a rof ti tuoba knihT **loot siht nur nac sresu_nimda
-dluow taht gniht ylno eht ,revres yxalaG ruoy no tpircs yrartibra yna nur
-ylbaborp dluow atad yxalaG ruoy lla gniyortsed no tneb tnaercsim a edepmi
-.slliks lacinhcet etairporppa fo kcal eb
-
-**seod ti tahW**
-
-dna R ,nohtyp ni stpircs elpmis rof yrotcaf loot a si sihT
-.taht si looc woH .detareneg yllacitamotua era stset lanoitcnuF .yltnerruc lrep
-
-nac yllanoitpO .yrotsih eht morf tupni eno daer taht stpircs elpmis ot DETIMIL
-stuptuo fo rebmun yna tcelloc yllanoitpo dna ,tesatad yrotsih wen eno etirw
-- etagivan ot resu eht rof egap xedni LMTH detarenegotua na no sknil otni
-nwohs era stuptuo fdp - selif tuptuo dna segami setirw tpircs eht fi lufesu
-dna taht os tpircstsohg htiw knurhs era s'fdp detaolb s'R dna slianbmuht sa
-.elbaliava eb ot deen kigamegami
-
-trats os ,loot yxalaG yna ekil decnahne dna detide eb nac sloot detareneG
-a ot pu gel suoires a uoy steg tpircs detareneg a ecnis pu dliub dna llams
-.eno xelpmoc erom
-
-**od uoy tahW**
-
-dna srorre xatnys eht xif uoy ,tpircs ruoy nur dna etsap uoY
-erofeb tpircs eht tide dna nottub oder eht esu nac uoY .snur ti yllautneve
-.llew ytterp skrow ti - gubed uoy sa ti nurer ot gniyrt
-
-elbitapmoc dehsloot a etareneg nac uoy ,atad tset emos no skrow tpircs eht ecnO
-ni loot yxalaG yranidro na sa nur ot ydaer tpircs ruoy gniniatnoc elif pizg
-detamotua ylegral dna efas snaem tahT .dehsloot lacol ruoy no yrotisoper a
-.dehsloot ruoy esu ot derugifnoc yxalaG noitcudorp yna ni noitallatsni
-
-**ytiruceS loot detareneG**
-
-tsuj s'ti ,loot detareneg a llatsni uoy ecnO
-rieht dna yllamron nur tsuj yehT .efas si tpircs eht gnimussa - loot rehtona
-.dehsloot efas ecitcarp ,esaelp tub erucesni yllausunu gnihtyna od tonnac resu
-.yracs yllaer si ti - eno siht yllaicepsE .loot yna llatsni uoy erofeb edoc eht daeR
-
-**edoC dneS**
-
-?esaelp seussi tekcubtib sa emoclew snoitseggus dna sehctaP
-
-**noitubirttA**
-
-yrotcaF looT yxalaG ehT :stpircs morf sloot elbasu-er gnitaerC
-maeT yxalaG ehT ;nnameiZ kraM ;ipsaK ynotnA ;surazaL ssoR
-375stb/scitamrofnioib/3901.01 :iod ;2102 scitamrofnioiB
-
-fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
-
-**gnisneciL**
-
-0102 surazaL ssoR thgirypoC
-moc doirep liam g ta surazal ssor
-
-.devreser sthgir llA
-
-LPGL eht rednu desneciL
-
-**tohsneercs yrotagilbO**
-
-gnp.looTtpircScimanyd/segami/989ef2308adf/crs/rekamlootyxalag/rabuf/gro.tekcubtib//:ptth
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/pyrevpos.python
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/pyrevpos.python Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,13 +0,0 @@
-# reverse order of text by row
-import sys
-inp = sys.argv[1]
-outp = sys.argv[2]
-i = open(inp,'r').readlines()
-o = open(outp,'w')
-for row in i:
-   rs = row.rstrip()
-   rs = list(rs)
-   rs.reverse()
-   o.write(''.join(rs))
-o.close() 
-
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/test1_log.txt
--- a/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/test1_log.txt Sun Aug 23 21:02:03 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,1 +0,0 @@
-## Executing Toolfactory generated command line = python /tmp/pyrevposq5dmcdy1.python /tmp/tmpqrksf8sd/files/5/b/9/dataset_5b952a86-87df-44ad-a415-ea549f3f0cee.dat output2
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
b
Binary file home/ross/galaxy/tools/tool_makers/toolfactory/test-data/toolfactory_pyrevpos_tgz_sample has changed
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/.shed.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/.shed.yml Sun Aug 23 21:03:48 2020 -0400
b
@@ -0,0 +1,13 @@
+name: toolfactory
+owner: fubar
+description: ToolFactory - tool to make Galaxy tools ready for the toolshed
+homepage_url: https://github.com/fubar2/toolfactory
+long_description: |
+    ToolFactory - turn executable packages and R/python/perl/bash scripts into ordinary Galaxy tools
+
+    Creating re-usable tools from scripts: The Galaxy Tool Factory Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team 
+    Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
+remote_repository_url: https://github.com/fubar2/toolfactory
+type: tool_dependency_definition
+categories:
+- Tool Generators
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/LICENSE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/LICENSE Sun Aug 23 21:03:48 2020 -0400
b
b"@@ -0,0 +1,504 @@\n+GNU LESSER GENERAL PUBLIC LICENSE\n+                       Version 2.1, February 1999\n+\n+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n+ Everyone is permitted to copy and distribute verbatim copies\n+ of this license document, but changing it is not allowed.\n+\n+(This is the first released version of the Lesser GPL.  It also counts\n+ as the successor of the GNU Library Public License, version 2, hence\n+ the version number 2.1.)\n+\n+                            Preamble\n+\n+  The licenses for most software are designed to take away your\n+freedom to share and change it.  By contrast, the GNU General Public\n+Licenses are intended to guarantee your freedom to share and change\n+free software--to make sure the software is free for all its users.\n+\n+  This license, the Lesser General Public License, applies to some\n+specially designated software packages--typically libraries--of the\n+Free Software Foundation and other authors who decide to use it.  You\n+can use it too, but we suggest you first think carefully about whether\n+this license or the ordinary General Public License is the better\n+strategy to use in any particular case, based on the explanations below.\n+\n+  When we speak of free software, we are referring to freedom of use,\n+not price.  Our General Public Licenses are designed to make sure that\n+you have the freedom to distribute copies of free software (and charge\n+for this service if you wish); that you receive source code or can get\n+it if you want it; that you can change the software and use pieces of\n+it in new free programs; and that you are informed that you can do\n+these things.\n+\n+  To protect your rights, we need to make restrictions that forbid\n+distributors to deny you these rights or to ask you to surrender these\n+rights.  These restrictions translate to certain responsibilities for\n+you if you distribute copies of the library or if you modify it.\n+\n+  For example, if you distribute copies of the library, whether gratis\n+or for a fee, you must give the recipients all the rights that we gave\n+you.  You must make sure that they, too, receive or can get the source\n+code.  If you link other code with the library, you must provide\n+complete object files to the recipients, so that they can relink them\n+with the library after making changes to the library and recompiling\n+it.  And you must show them these terms so they know their rights.\n+\n+  We protect your rights with a two-step method: (1) we copyright the\n+library, and (2) we offer you this license, which gives you legal\n+permission to copy, distribute and/or modify the library.\n+\n+  To protect each distributor, we want to make it very clear that\n+there is no warranty for the free library.  Also, if the library is\n+modified by someone else and passed on, the recipients should know\n+that what they have is not the original version, so that the original\n+author's reputation will not be affected by problems that might be\n+introduced by others.\n+\n+  Finally, software patents pose a constant threat to the existence of\n+any free program.  We wish to make sure that a company cannot\n+effectively restrict the users of a free program by obtaining a\n+restrictive license from a patent holder.  Therefore, we insist that\n+any patent license obtained for a version of the library must be\n+consistent with the full freedom of use specified in this license.\n+\n+  Most GNU software, including some libraries, is covered by the\n+ordinary GNU General Public License.  This license, the GNU Lesser\n+General Public License, applies to certain designated libraries, and\n+is quite different from the ordinary General Public License.  We use\n+this license for certain libraries in order to permit linking those\n+libraries into non-free programs.\n+\n+  When a program is linked with a library, whether statically or using\n+a shared library, the combination of the two is legally speaking a\n+combined work, a derivative "..b'oes not specify a\n+license version number, you may choose any version ever published by\n+the Free Software Foundation.\n+\n+  14. If you wish to incorporate parts of the Library into other free\n+programs whose distribution conditions are incompatible with these,\n+write to the author to ask for permission.  For software which is\n+copyrighted by the Free Software Foundation, write to the Free\n+Software Foundation; we sometimes make exceptions for this.  Our\n+decision will be guided by the two goals of preserving the free status\n+of all derivatives of our free software and of promoting the sharing\n+and reuse of software generally.\n+\n+                            NO WARRANTY\n+\n+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\n+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\n+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\n+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\n+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\n+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n+\n+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\n+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\n+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\n+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\n+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\n+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\n+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\n+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n+DAMAGES.\n+\n+                     END OF TERMS AND CONDITIONS\n+\n+           How to Apply These Terms to Your New Libraries\n+\n+  If you develop a new library, and you want it to be of the greatest\n+possible use to the public, we recommend making it free software that\n+everyone can redistribute and change.  You can do so by permitting\n+redistribution under these terms (or, alternatively, under the terms of the\n+ordinary General Public License).\n+\n+  To apply these terms, attach the following notices to the library.  It is\n+safest to attach them to the start of each source file to most effectively\n+convey the exclusion of warranty; and each file should have at least the\n+"copyright" line and a pointer to where the full notice is found.\n+\n+    {description}\n+    Copyright (C) {year} {fullname}\n+\n+    This library is free software; you can redistribute it and/or\n+    modify it under the terms of the GNU Lesser General Public\n+    License as published by the Free Software Foundation; either\n+    version 2.1 of the License, or (at your option) any later version.\n+\n+    This library is distributed in the hope that it will be useful,\n+    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+    Lesser General Public License for more details.\n+\n+    You should have received a copy of the GNU Lesser General Public\n+    License along with this library; if not, write to the Free Software\n+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n+    USA\n+\n+Also add information on how to contact you by electronic and paper mail.\n+\n+You should also get your employer (if you work as a programmer) or your\n+school, if any, to sign a "copyright disclaimer" for the library, if\n+necessary.  Here is a sample; alter the names:\n+\n+  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n+  library `Frob\' (a library for tweaking knobs) written by James Random\n+  Hacker.\n+\n+  {signature of Ty Coon}, 1 April 1990\n+  Ty Coon, President of Vice\n+\n+That\'s all there is to it!\n'
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/README.md Sun Aug 23 21:03:48 2020 -0400
b
@@ -0,0 +1,166 @@
+*WARNING before you start*
+
+ Install this tool on a private Galaxy ONLY
+ Please NEVER on a public or production instance

+Updated august 2014 by John Chilton adding citation support
+
+Updated august 8 2014 to fix bugs reported by Marius van den Beek
+
+Please cite the resource at
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+if you use this tool in your published work.
+
+**Short Story**
+
+This is an unusual Galaxy tool capable of generating new Galaxy tools.
+It works by exposing *unrestricted* and therefore extremely dangerous scripting
+to all designated administrators of the host Galaxy server, allowing them to
+run scripts in R, python, sh and perl over multiple selected input data sets,
+writing a single new data set as output.
+
+*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
+
+It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
+
+
+**Automated generation of new Galaxy tools for installation into any Galaxy**
+
+A test is generated using small sample test data inputs and parameter settings you supply.
+Once the test case outputs have been produced, they can be used to build a
+new Galaxy tool. The supplied script or executable is baked as a requirement
+into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
+Generated tools are installed via a tool shed by an administrator
+and work exactly like all other Galaxy tools for your users.
+
+**More Detail**
+
+To use the ToolFactory, you should have prepared a script to paste into a
+text box, or have a package in mind and a small test input example ready to select from your history
+to test your new script.
+
+```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
+
+There is an example in each scripting language on the Tool Factory form. You
+can just cut and paste these to try it out - remember to select the right
+interpreter please. You'll also need to create a small test data set using
+the Galaxy history add new data tool.
+
+If the script fails somehow, use the "redo" button on the tool output in
+your history to recreate the form complete with broken script. Fix the bug
+and execute again. Rinse, wash, repeat.
+
+Once the script runs sucessfully, a new Galaxy tool that runs your script
+can be generated. Select the "generate" option and supply some help text and
+names. The new tool will be generated in the form of a new Galaxy datatype
+*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
+Galaxy ToolShed as a new tool repository.
+
+Once it's in a ToolShed, it can be installed into any local Galaxy server
+from the server administrative interface.
+
+Once the new tool is installed, local users can run it - each time, the script
+that was supplied when it was built will be executed with the input chosen
+from the user's history. In other words, the tools you generate with the
+ToolFactory run just like any other Galaxy tool,but run your script every time.
+
+Tool factory tools are perfect for workflow components. One input, one output,
+no variables.
+
+*To fully and safely exploit the awesome power* of this tool,
+Galaxy and the ToolShed, you should be a developer installing this
+tool on a private/personal/scratch local instance where you are an
+admin_user. Then, if you break it, you get to keep all the pieces see
+https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
+
+**Installation**
+This is a Galaxy tool. You can install it most conveniently using the
+administrative "Search and browse tool sheds" link. Find the Galaxy Main
+toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
+repository. Open it and review the code and select the option to install it.
+
+If you can't get the tool that way, the xml and py files here need to be
+copied into a new tools
+subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
+pointing to the xml
+file - something like::
+
+  <section name="Tool building tools" id="toolbuilders">
+    <tool file="toolfactory/rgToolFactory.xml"/>
+  </section>
+
+If not already there,
+please add:
+<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
+mimetype="multipart/x-gzip" subclass="True" />
+to your local data_types_conf.xml.
+
+
+**Restricted execution**
+
+The tool factory tool itself will then be usable ONLY by admin users -
+people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
+admin_users can run this tool** Think about it for a moment. If allowed to
+run any arbitrary script on your Galaxy server, the only thing that would
+impede a miscreant bent on destroying all your Galaxy data would probably
+be lack of appropriate technical skills.
+
+**What it does** 
+
+This is a tool factory for simple scripts in python, R and
+perl currently. Functional tests are automatically generated. How cool is that.
+
+LIMITED to simple scripts that read one input from the history. Optionally can
+write one new history dataset, and optionally collect any number of outputs
+into links on an autogenerated HTML index page for the user to navigate -
+useful if the script writes images and output files - pdf outputs are shown
+as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
+imagemagik need to be available.
+
+Generated tools can be edited and enhanced like any Galaxy tool, so start
+small and build up since a generated script gets you a serious leg up to a
+more complex one.
+
+**What you do**
+
+You paste and run your script, you fix the syntax errors and
+eventually it runs. You can use the redo button and edit the script before
+trying to rerun it as you debug - it works pretty well.
+
+Once the script works on some test data, you can generate a toolshed compatible
+gzip file containing your script ready to run as an ordinary Galaxy tool in
+a repository on your local toolshed. That means safe and largely automated
+installation in any production Galaxy configured to use your toolshed.
+
+**Generated tool Security**
+
+Once you install a generated tool, it's just
+another tool - assuming the script is safe. They just run normally and their
+user cannot do anything unusually insecure but please, practice safe toolshed.
+Read the code before you install any tool. Especially this one - it is really scary.
+
+**Send Code**
+
+Patches and suggestions welcome as bitbucket issues please?
+
+**Attribution**
+
+Creating re-usable tools from scripts: The Galaxy Tool Factory
+Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
+Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
+
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+
+**Licensing**
+
+Copyright Ross Lazarus 2010
+ross lazarus at g mail period com
+
+All rights reserved.
+
+Licensed under the LGPL
+
+**Obligatory screenshot**
+
+http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
+
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/images/dynamicScriptTool.png
b
Binary file toolfactory/images/dynamicScriptTool.png has changed
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/rgToolFactory2.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/rgToolFactory2.py Sun Aug 23 21:03:48 2020 -0400
[
b'@@ -0,0 +1,843 @@\n+#!/usr/bin/env python\n+# rgToolFactory.py\n+# see https://github.com/fubar2/toolfactory\n+#\n+# copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012\n+#\n+# all rights reserved\n+# Licensed under the LGPL\n+# suggestions for improvement and bug fixes welcome at https://github.com/fubar2/toolfactory\n+#\n+# July 2020: BCC was fun and I feel like rip van winkle after 5 years.\n+# Decided to\n+# 1. Fix the toolfactory so it works - done for simplest case\n+# 2. Fix planemo so the toolfactory function works\n+# 3. Rewrite bits using galaxyxml functions where that makes sense - done\n+#\n+# removed all the old complications including making the new tool use this same script\n+# galaxyxml now generates the tool xml https://github.com/hexylena/galaxyxml\n+# No support for automatic HTML file creation from arbitrary outputs\n+# essential problem is to create two command lines - one for the tool xml and a different\n+# one to run the executable with the supplied test data and settings\n+# Be simpler to write the tool, then run it with planemo and soak up the test outputs.\n+\n+\n+\n+import argparse\n+import logging\n+import os\n+import re\n+import shutil\n+import subprocess\n+import sys\n+import tarfile\n+import tempfile\n+import time\n+\n+import galaxyxml.tool as gxt\n+import galaxyxml.tool.parameters as gxtp\n+\n+import lxml\n+\n+import yaml\n+\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\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~~~\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+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+    return time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(time.time()))\n+\n+\n+def quote_non_numeric(s):\n+    """return a prequoted string for non-numerics\n+    useful for perl and Rscript parameter passing?\n+    """\n+    try:\n+        _ = float(s)\n+        return s\n+    except ValueError:\n+        return \'"%s"\' % s\n+\n+\n+html_escape_table = {"&": "&amp;", ">": "&gt;", "<": "&lt;", "$": r"\\$"}\n+\n+\n+def html_escape(text):\n+    """Produce entities within text."""\n+    return "".join(html_escape_table.get(c, c) for c in text)\n+\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+    return t\n+\n+\n+def parse_citations(citations_text):\n+    """\n+    """\n+    citations = [c for c in citations_text.split("**ENTRY**") if c.strip()]\n+    citation_tuples = []\n+    for citation in citations:\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+            )\n+    return citation_tuples\n+\n+\n+class ScriptRunner:\n+    """Wrapper for an arbitrary script\n+    uses galaxyxml\n+\n+    """\n+\n+    def __init__(self, args=None):\n+        """\n+        prepare command line cl for running the tool here\n+        and prepare elements needed for galaxyxml tool generation\n+        """\n+\n+        self.infiles = [x.split(ourdelim) for x in args.input_files]\n+        self.outfiles = [x.split(ourdelim) for x in args.output_files]\n+        self.addpar = [x.split(ourdelim) for x in args.additional_parameters]\n+        self.args = args\n+        self.cleanuppar()\n+        s'..b'elf):\n+        """\n+        """\n+        cll = [\'shed-tools\', \'install\', \'-g\', self.args.galaxy_url, \'--latest\',\n+           \'-a\', self.args.galaxy_api_key , \'--name\', self.args.tool_name, \'--owner\',\'fubar\',\n+           \'--toolshed\', self.args.toolshed_url,\n+           \'--section_label\',\'Generated Tools\',\'--install_tool_dependencies\',]\n+        print(\'running\\n\',\' \'.join(cll))\n+        p = subprocess.run(cll, shell=False)\n+        if p.returncode != 0:\n+            print(\'Repository %s installation returned %d\' % (self.args.tool_name,p.retcode))\n+        else:\n+            print(\'installed %s\' % self.args.tool_name)\n+        return p.returncode\n+\n+    def writeShedyml(self):\n+        yuser = self.args.user_email.split(\'@\')[0]\n+        yfname = os.path.join(self.tooloutdir,\'.shed.yml\')\n+        yamlf = open(yfname, \'w\')\n+        odict = {\'name\':self.tool_name,\'owner\':yuser,\'type\':\'unrestricted\',\'description\':self.args.tool_desc}\n+        yaml.dump(odict, yamlf, allow_unicode=True)\n+        yamlf.close()\n+\n+def main():\n+    """\n+    This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as:\n+    <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" --tool_name "foo" --interpreter "Rscript"\n+    </command>\n+    """\n+    parser = argparse.ArgumentParser()\n+    a = parser.add_argument\n+    a("--script_path", default="")\n+    a("--dependencies", default="")\n+    a("--cl_override", 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("--galaxy_url", default="http://localhost")\n+    a("--galaxy_api_key", default=\'fakekey\')\n+    a("--toolshed_url", default="http://localhost:9009")\n+    a("--toolshed_api_key", default=None)\n+    a("--planemo_test", default="yes")\n+\n+    args = parser.parse_args()\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 (\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 = [\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+            \'"\', ""\n+        )\n+    r = ScriptRunner(args)\n+    if args.make_Tool:\n+        r.writeShedyml()\n+        retcode = r.makeTooltar()\n+        if retcode == 0:\n+            if args.planemo_test == "yes":\n+                r.install_load()\n+    else:\n+        retcode = r.run()\n+    # if retcode:\n+        # sys.exit(retcode)  # indicate failure to job runner\n+\n+\n+if __name__ == "__main__":\n+    main()\n'
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/rgToolFactory2.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/rgToolFactory2.xml Sun Aug 23 21:03:48 2020 -0400
[
b'@@ -0,0 +1,476 @@\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" 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+               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\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"\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+              <mapping initial="none"/>\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">\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" 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" 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_conf.xml" value="tabular">\n+               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\n+                <column name="value" index="0"/>\n+               </options>\n+            </param>\n+            <param name="history_CL" type="text"  label="Positional: ordinal integer. Argparse: argument name expected for this output parameter. Use STDOUT if \'>\' required."\n+              help="If positional parameters, enter the integer ordinal expected for this parameter. If Argparse style, \'--\' will be prepended or \'-\' if single character" value=""/>\n+        </repeat>\n+     </xml>\n+     <xml name="additparam">\n+        <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?"\n+             help="If no (default), users will NOT be able to alter any additional parameters.'..b'); 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+(see GTF_)\n+\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+Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_\n+\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+Pasted scripts are written so they are part of the new tool and cannot be adjusted by the downstream user.\n+Binary packages are managed by the dependency subsystem - conda usually, so anything in bioconda or conda_forge is available for example.\n+\n+Any number of parameters can be built into the new tool form for passing in to the script or executable at runtime.\n+These can be editable by the downstream user or baked in.\n+\n+When you run this tool, your executable or script and supplied parameter values will be run to produce a canonical\n+set of outputs - these are used to construct a test for the new tool.\n+\n+If tool generation is required, a new tarball compatible with any Galaxy toolshed is created.\n+It can be unpacked in your galaxy/tools directory and manually added to tool_conf.xml, or\n+installed into any toolshed from where it can be installed into your Galaxy.\n+\n+\n+.. class:: warningmark\n+\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+.. class:: warningmark\n+\n+**Use on public servers**  is STRONGLY discouraged for obvious reasons\n+\n+The tools generated by this tool will run just as securely as any other normal installed Galaxy tool but like any other new tools, should always be checked carefully before installation.\n+We recommend that you follow the good code hygiene practices associated with safe toolshed practices.\n+\n+Here\'s a sample python script that can be cut and pasted into the tool form, suitable for positional parameter passing:\n+\n+::\n+\n+    # reverse order of text by row\n+    import sys\n+    inp = sys.argv[1]\n+    outp = sys.argv[2]\n+    i = open(inp,\'r\').readlines()\n+    o = open(outp,\'w\')\n+    for row in i:\n+      rs = row.rstrip()\n+      rs = list(rs)\n+      rs.reverse()\n+      o.write(\'\'.join(rs))\n+      o.write(\'\\n\')\n+    o.close()\n+\n+With argparse style parameters:\n+\n+::\n+\n+    # reverse order of text by row\n+    import argparse\n+    parser = argparse.ArgumentParser()\n+    a = parser.add_argument\n+    a(\'--infile\',default=\'\')\n+    a(\'--outfile\',default=None)\n+    args = parser.parse_args()\n+    inp = args.infile\n+    outp = args.outfile\n+    i = open(inp,\'r\').readlines()\n+    o = open(outp,\'w\')\n+    for row in i:\n+      rs = row.rstrip()\n+      rs = list(rs)\n+      rs.reverse()\n+      o.write(\'\'.join(rs))\n+      o.write(\'\\n\')\n+    o.close()\n+\n+\n+Paper_ :\n+\n+Creating re-usable tools from scripts: The Galaxy Tool Factory\n+Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team\n+Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573\n+\n+**Licensing**\n+\n+Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012\n+All rights reserved.\n+Licensed under the LGPL_\n+\n+.. _LGPL: http://www.gnu.org/copyleft/lesser.html\n+.. _GTF:  https://github.com/fubar2/toolfactory\n+.. _Paper: http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573\n+\n+\n+</help>\n+<citations>\n+    <citation type="doi">10.1093/bioinformatics/bts573</citation>\n+</citations>\n+</tool>\n+\n+\n'
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/test-data/input1_sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/test-data/input1_sample Sun Aug 23 21:03:48 2020 -0400
b
@@ -0,0 +1,166 @@
+*WARNING before you start*
+
+ Install this tool on a private Galaxy ONLY
+ Please NEVER on a public or production instance

+Updated august 2014 by John Chilton adding citation support
+
+Updated august 8 2014 to fix bugs reported by Marius van den Beek
+
+Please cite the resource at
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+if you use this tool in your published work.
+
+**Short Story**
+
+This is an unusual Galaxy tool capable of generating new Galaxy tools.
+It works by exposing *unrestricted* and therefore extremely dangerous scripting
+to all designated administrators of the host Galaxy server, allowing them to
+run scripts in R, python, sh and perl over multiple selected input data sets,
+writing a single new data set as output.
+
+*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
+
+It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
+
+
+**Automated generation of new Galaxy tools for installation into any Galaxy**
+
+A test is generated using small sample test data inputs and parameter settings you supply.
+Once the test case outputs have been produced, they can be used to build a
+new Galaxy tool. The supplied script or executable is baked as a requirement
+into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
+Generated tools are installed via a tool shed by an administrator
+and work exactly like all other Galaxy tools for your users.
+
+**More Detail**
+
+To use the ToolFactory, you should have prepared a script to paste into a
+text box, or have a package in mind and a small test input example ready to select from your history
+to test your new script.
+
+```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
+
+There is an example in each scripting language on the Tool Factory form. You
+can just cut and paste these to try it out - remember to select the right
+interpreter please. You'll also need to create a small test data set using
+the Galaxy history add new data tool.
+
+If the script fails somehow, use the "redo" button on the tool output in
+your history to recreate the form complete with broken script. Fix the bug
+and execute again. Rinse, wash, repeat.
+
+Once the script runs sucessfully, a new Galaxy tool that runs your script
+can be generated. Select the "generate" option and supply some help text and
+names. The new tool will be generated in the form of a new Galaxy datatype
+*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
+Galaxy ToolShed as a new tool repository.
+
+Once it's in a ToolShed, it can be installed into any local Galaxy server
+from the server administrative interface.
+
+Once the new tool is installed, local users can run it - each time, the script
+that was supplied when it was built will be executed with the input chosen
+from the user's history. In other words, the tools you generate with the
+ToolFactory run just like any other Galaxy tool,but run your script every time.
+
+Tool factory tools are perfect for workflow components. One input, one output,
+no variables.
+
+*To fully and safely exploit the awesome power* of this tool,
+Galaxy and the ToolShed, you should be a developer installing this
+tool on a private/personal/scratch local instance where you are an
+admin_user. Then, if you break it, you get to keep all the pieces see
+https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
+
+**Installation**
+This is a Galaxy tool. You can install it most conveniently using the
+administrative "Search and browse tool sheds" link. Find the Galaxy Main
+toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
+repository. Open it and review the code and select the option to install it.
+
+If you can't get the tool that way, the xml and py files here need to be
+copied into a new tools
+subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
+pointing to the xml
+file - something like::
+
+  <section name="Tool building tools" id="toolbuilders">
+    <tool file="toolfactory/rgToolFactory.xml"/>
+  </section>
+
+If not already there,
+please add:
+<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
+mimetype="multipart/x-gzip" subclass="True" />
+to your local data_types_conf.xml.
+
+
+**Restricted execution**
+
+The tool factory tool itself will then be usable ONLY by admin users -
+people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
+admin_users can run this tool** Think about it for a moment. If allowed to
+run any arbitrary script on your Galaxy server, the only thing that would
+impede a miscreant bent on destroying all your Galaxy data would probably
+be lack of appropriate technical skills.
+
+**What it does** 
+
+This is a tool factory for simple scripts in python, R and
+perl currently. Functional tests are automatically generated. How cool is that.
+
+LIMITED to simple scripts that read one input from the history. Optionally can
+write one new history dataset, and optionally collect any number of outputs
+into links on an autogenerated HTML index page for the user to navigate -
+useful if the script writes images and output files - pdf outputs are shown
+as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
+imagemagik need to be available.
+
+Generated tools can be edited and enhanced like any Galaxy tool, so start
+small and build up since a generated script gets you a serious leg up to a
+more complex one.
+
+**What you do**
+
+You paste and run your script, you fix the syntax errors and
+eventually it runs. You can use the redo button and edit the script before
+trying to rerun it as you debug - it works pretty well.
+
+Once the script works on some test data, you can generate a toolshed compatible
+gzip file containing your script ready to run as an ordinary Galaxy tool in
+a repository on your local toolshed. That means safe and largely automated
+installation in any production Galaxy configured to use your toolshed.
+
+**Generated tool Security**
+
+Once you install a generated tool, it's just
+another tool - assuming the script is safe. They just run normally and their
+user cannot do anything unusually insecure but please, practice safe toolshed.
+Read the code before you install any tool. Especially this one - it is really scary.
+
+**Send Code**
+
+Patches and suggestions welcome as bitbucket issues please?
+
+**Attribution**
+
+Creating re-usable tools from scripts: The Galaxy Tool Factory
+Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
+Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
+
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+
+**Licensing**
+
+Copyright Ross Lazarus 2010
+ross lazarus at g mail period com
+
+All rights reserved.
+
+Licensed under the LGPL
+
+**Obligatory screenshot**
+
+http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
+
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/test-data/output2_sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/test-data/output2_sample Sun Aug 23 21:03:48 2020 -0400
b
@@ -0,0 +1,165 @@
+*trats uoy erofeb GNINRAW*
+
+YLNO yxalaG etavirp a no loot siht llatsnI 
+ecnatsni noitcudorp ro cilbup a no REVEN esaelP 
+
+troppus noitatic gnidda notlihC nhoJ yb 4102 tsugua detadpU
+
+keeB ned nav suiraM yb detroper sgub xif ot 4102 8 tsugua detadpU
+
+ta ecruoser eht etic esaelP
+fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
+.krow dehsilbup ruoy ni loot siht esu uoy fi
+
+**yrotS trohS**
+
+.sloot yxalaG wen gnitareneg fo elbapac loot yxalaG lausunu na si sihT
+gnitpircs suoregnad ylemertxe erofereht dna *detcirtsernu* gnisopxe yb skrow tI
+ot meht gniwolla ,revres yxalaG tsoh eht fo srotartsinimda detangised lla ot
+,stes atad tupni detceles elpitlum revo lrep dna hs ,nohtyp ,R ni stpircs nur
+.tuptuo sa tes atad wen elgnis a gnitirw
+
+*sretemarap elyts esrapgra ro lanoitisop htiw elbatucexe yna ro tpircs hsab/lrep/nohtyp/r gnikrow a evah uoY*
+
+.loot yxalaG a gnisu ,setunim ni loot yxalaG yranidro na otni denrut eb nac tI
+
+
+**yxalaG yna otni noitallatsni rof sloot yxalaG wen fo noitareneg detamotuA**
+
+.ylppus uoy sgnittes retemarap dna stupni atad tset elpmas llams gnisu detareneg si tset A
+a dliub ot desu eb nac yeht ,decudorp neeb evah stuptuo esac tset eht ecnO
+tnemeriuqer a sa dekab si elbatucexe ro tpircs deilppus ehT .loot yxalaG wen
+.xob eht fo tuo elbitapmoc wolfkrow ylluf ,loot yxalaG yranidro ,wen a otni
+rotartsinimda na yb dehs loot a aiv dellatsni era sloot detareneG
+.sresu ruoy rof sloot yxalaG rehto lla ekil yltcaxe krow dna
+
+**liateD eroM**
+
+a otni etsap ot tpircs a deraperp evah dluohs uoy ,yrotcaFlooT eht esu oT
+yrotsih ruoy morf tceles ot ydaer elpmaxe tupni tset llams a dna dnim ni egakcap a evah ro ,xob txet
+.tpircs wen ruoy tset ot
+
+em rof skrow ```atad-tset/yrotcafloot/srekam_loot/sloot/yxalag/~ atad_tset-- yxalag/~ toor_yxalag-- lmx.2yrotcaFlooTgr tset omenalp```
+
+uoY .mrof yrotcaF looT eht no egaugnal gnitpircs hcae ni elpmaxe na si erehT
+thgir eht tceles ot rebmemer - tuo ti yrt ot eseht etsap dna tuc tsuj nac
+gnisu tes atad tset llams a etaerc ot deen osla ll'uoY .esaelp reterpretni
+.loot atad wen dda yrotsih yxalaG eht
+
+ni tuptuo loot eht no nottub "oder" eht esu ,wohemos sliaf tpircs eht fI
+gub eht xiF .tpircs nekorb htiw etelpmoc mrof eht etaercer ot yrotsih ruoy
+.taeper ,hsaw ,esniR .niaga etucexe dna
+
+tpircs ruoy snur taht loot yxalaG wen a ,yllufssecus snur tpircs eht ecnO
+dna txet pleh emos ylppus dna noitpo "etareneg" eht tceleS .detareneg eb nac
+epytatad yxalaG wen a fo mrof eht ni detareneg eb lliw loot wen ehT .seman
+a ot daolpu ot ydaer evihcra na s'ti ,stseggus eman eht sa - *zg.dehsloot*
+.yrotisoper loot wen a sa dehSlooT yxalaG
+
+revres yxalaG lacol yna otni dellatsni eb nac ti ,dehSlooT a ni s'ti ecnO
+.ecafretni evitartsinimda revres eht morf
+
+tpircs eht ,emit hcae - ti nur nac sresu lacol ,dellatsni si loot wen eht ecnO
+nesohc tupni eht htiw detucexe eb lliw tliub saw ti nehw deilppus saw taht
+eht htiw etareneg uoy sloot eht ,sdrow rehto nI .yrotsih s'resu eht morf
+.emit yreve tpircs ruoy nur tub,loot yxalaG rehto yna ekil tsuj nur yrotcaFlooT
+
+,tuptuo eno ,tupni enO .stnenopmoc wolfkrow rof tcefrep era sloot yrotcaf looT
+.selbairav on
+
+,loot siht fo *rewop emosewa eht tiolpxe ylefas dna ylluf oT*
+siht gnillatsni repoleved a eb dluohs uoy ,dehSlooT eht dna yxalaG
+na era uoy erehw ecnatsni lacol hctarcs/lanosrep/etavirp a no loot
+ees seceip eht lla peek ot teg uoy ,ti kaerb uoy fi ,nehT .resu_nimda
+emoH/ikiw/yrotcaflootyxalag/rabuf/gro.tekcubtib//:sptth
+
+**noitallatsnI**
+eht gnisu yltneinevnoc tsom ti llatsni nac uoY .loot yxalaG a si sihT
+niaM yxalaG eht dniF .knil "sdehs loot esworb dna hcraeS" evitartsinimda
+yrotcafloot eht rof hcraes dna /ude.usp.xb.2g.dehsloot//:sptth ta dehsloot
+.ti llatsni ot noitpo eht tceles dna edoc eht weiver dna ti nepO .yrotisoper
+
+eb ot deen ereh selif yp dna lmx eht ,yaw taht loot eht teg t'nac uoy fI
+sloot wen a otni deipoc
+yrtne wen a sdeen lmx.fnoc_loot ruoY yrotcafloot/sloot sa hcus yrotceridbus
+lmx eht ot gnitniop
+::ekil gnihtemos - elif
+
+>"sredliubloot"=di "sloot gnidliub looT"=eman noitces<  
+>/"lmx.yrotcaFlooTgr/yrotcafloot"=elif loot<    
+>noitces/<  
+
+,ereht ydaerla ton fI
+:dda esaelp
+"yraniB:yranib.sepytatad.yxalag"=epyt "zg.dehsloot"=noisnetxe epytatad<
+>/ "eurT"=ssalcbus "pizg-x/trapitlum"=epytemim
+.lmx.fnoc_sepyt_atad lacol ruoy ot
+
+
+**noitucexe detcirtseR**
+
+- sresu nimda yb YLNO elbasu eb neht lliw flesti loot yrotcaf loot ehT
+YLNO .thgir s'taht ,seY** ini.igsw_esrevinu ni sresu_nimda ni sDI htiw elpoep
+ot dewolla fI .tnemom a rof ti tuoba knihT **loot siht nur nac sresu_nimda
+dluow taht gniht ylno eht ,revres yxalaG ruoy no tpircs yrartibra yna nur
+ylbaborp dluow atad yxalaG ruoy lla gniyortsed no tneb tnaercsim a edepmi
+.slliks lacinhcet etairporppa fo kcal eb
+
+**seod ti tahW**
+
+dna R ,nohtyp ni stpircs elpmis rof yrotcaf loot a si sihT
+.taht si looc woH .detareneg yllacitamotua era stset lanoitcnuF .yltnerruc lrep
+
+nac yllanoitpO .yrotsih eht morf tupni eno daer taht stpircs elpmis ot DETIMIL
+stuptuo fo rebmun yna tcelloc yllanoitpo dna ,tesatad yrotsih wen eno etirw
+- etagivan ot resu eht rof egap xedni LMTH detarenegotua na no sknil otni
+nwohs era stuptuo fdp - selif tuptuo dna segami setirw tpircs eht fi lufesu
+dna taht os tpircstsohg htiw knurhs era s'fdp detaolb s'R dna slianbmuht sa
+.elbaliava eb ot deen kigamegami
+
+trats os ,loot yxalaG yna ekil decnahne dna detide eb nac sloot detareneG
+a ot pu gel suoires a uoy steg tpircs detareneg a ecnis pu dliub dna llams
+.eno xelpmoc erom
+
+**od uoy tahW**
+
+dna srorre xatnys eht xif uoy ,tpircs ruoy nur dna etsap uoY
+erofeb tpircs eht tide dna nottub oder eht esu nac uoY .snur ti yllautneve
+.llew ytterp skrow ti - gubed uoy sa ti nurer ot gniyrt
+
+elbitapmoc dehsloot a etareneg nac uoy ,atad tset emos no skrow tpircs eht ecnO
+ni loot yxalaG yranidro na sa nur ot ydaer tpircs ruoy gniniatnoc elif pizg
+detamotua ylegral dna efas snaem tahT .dehsloot lacol ruoy no yrotisoper a
+.dehsloot ruoy esu ot derugifnoc yxalaG noitcudorp yna ni noitallatsni
+
+**ytiruceS loot detareneG**
+
+tsuj s'ti ,loot detareneg a llatsni uoy ecnO
+rieht dna yllamron nur tsuj yehT .efas si tpircs eht gnimussa - loot rehtona
+.dehsloot efas ecitcarp ,esaelp tub erucesni yllausunu gnihtyna od tonnac resu
+.yracs yllaer si ti - eno siht yllaicepsE .loot yna llatsni uoy erofeb edoc eht daeR
+
+**edoC dneS**
+
+?esaelp seussi tekcubtib sa emoclew snoitseggus dna sehctaP
+
+**noitubirttA**
+
+yrotcaF looT yxalaG ehT :stpircs morf sloot elbasu-er gnitaerC
+maeT yxalaG ehT ;nnameiZ kraM ;ipsaK ynotnA ;surazaL ssoR
+375stb/scitamrofnioib/3901.01 :iod ;2102 scitamrofnioiB
+
+fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
+
+**gnisneciL**
+
+0102 surazaL ssoR thgirypoC
+moc doirep liam g ta surazal ssor
+
+.devreser sthgir llA
+
+LPGL eht rednu desneciL
+
+**tohsneercs yrotagilbO**
+
+gnp.looTtpircScimanyd/segami/989ef2308adf/crs/rekamlootyxalag/rabuf/gro.tekcubtib//:ptth
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/test-data/pyrevpos.python
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/test-data/pyrevpos.python Sun Aug 23 21:03:48 2020 -0400
[
@@ -0,0 +1,13 @@
+# reverse order of text by row
+import sys
+inp = sys.argv[1]
+outp = sys.argv[2]
+i = open(inp,'r').readlines()
+o = open(outp,'w')
+for row in i:
+   rs = row.rstrip()
+   rs = list(rs)
+   rs.reverse()
+   o.write(''.join(rs))
+o.close() 
+
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/test-data/test1_log.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/test-data/test1_log.txt Sun Aug 23 21:03:48 2020 -0400
b
@@ -0,0 +1,1 @@
+## Executing Toolfactory generated command line = python /tmp/pyrevposq5dmcdy1.python /tmp/tmpqrksf8sd/files/5/b/9/dataset_5b952a86-87df-44ad-a415-ea549f3f0cee.dat output2
b
diff -r e95d9fe5ab50 -r 5a7a5b06bce0 toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
b
Binary file toolfactory/test-data/toolfactory_pyrevpos_tgz_sample has changed