changeset 117:b1a29d3d50d6 draft

Uploaded
author fubar
date Sun, 06 Dec 2020 01:21:06 +0000
parents b1ea31ea3f00
children e43c43396a70
files toolfactory/rgToolFactory2.py toolfactory/rgToolFactory2.xml
diffstat 2 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/toolfactory/rgToolFactory2.py	Sat Dec 05 04:34:19 2020 +0000
+++ b/toolfactory/rgToolFactory2.py	Sun Dec 06 01:21:06 2020 +0000
@@ -635,7 +635,7 @@
             part2 = exml.split("</tests>")[1]
             fixed = "%s\n%s\n%s" % (part1, self.test_override, part2)
             exml = fixed
-        exml = exml.replace('range="1:"', 'range="1000:"')
+        #exml = exml.replace('range="1:"', 'range="1000:"')
         xf = open("%s.xml" % self.tool_name, "w")
         xf.write(exml)
         xf.write("\n")
@@ -756,7 +756,7 @@
         tvolname = tvol.name
         destdir = "/toolfactory/ptest"
         imrep = os.path.join(destdir, repname)
-        # need to keep the container running so keep it open with tail -f.
+        # need to keep the container running so keep it open with sleep
         # will stop and destroy it when we are done
         container = client.containers.run(
             planemoimage,
@@ -786,7 +786,8 @@
         try:
             prun(container, tout, cl)
         except:
-            pass
+            e = sys.exc_info()[0]
+            tout.write(f"#### error: {e} from {ptestcl}\n")
         testouts = tempfile.mkdtemp(suffix=None, prefix="tftemp", dir=".")
         self.copy_from_container(destdir, testouts, container)
         src = os.path.join(testouts, "ptest")
@@ -930,6 +931,10 @@
             filename = tarinfo.name
             return None if filename.endswith(excludeme) else tarinfo
 
+        if os.path.exists(self.tlog):
+            tout = open(self.tlog, "a")
+        else:
+            tout = open(self.tlog, "w")
         for p in self.outfiles:
             oname = p[ONAMEPOS]
             tdest = os.path.join(self.testdir, "%s_sample" % oname)
@@ -940,8 +945,8 @@
                     dest = os.path.join(self.repdir, "%s.sample" % (oname))
                     shutil.copyfile(src, dest)
                 else:
-                    print(
-                        "### problem - output file %s not found in testdir %s"
+                    tout.write(
+                        "###Output file %s not found in testdir %s. This is normal during the first Planemo run that generates test outputs"
                         % (tdest, self.testdir)
                     )
         tf = tarfile.open(self.newtarpath, "w:gz")
--- a/toolfactory/rgToolFactory2.xml	Sat Dec 05 04:34:19 2020 +0000
+++ b/toolfactory/rgToolFactory2.xml	Sun Dec 06 01:21:06 2020 +0000
@@ -69,7 +69,13 @@
         </repeat>
         <repeat name="history_outputs" title="one or more output file parameters generated by the tool to be added to the user history"
              help="The name will become a history item for users of the new tool you are making containing one of it's outputs">
-            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" help="Argparse will also use this name as --[name]"/>
+            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false"
+              help="No spaces! Argparse will also use this name as --[name]">
+              <sanitizer invalid_char="_">
+                <valid initial="string.letters,string.digits"/>
+                <add value="_" />
+              </sanitizer>
+            </param>
             <param name="history_format" type="select" multiple="false" label="Select the datatype for this output"
               help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml" value="tabular">
                <options from_parameter="tool.app.datatypes_registry.upload_file_formats">