changeset 129:c35ff02652bf draft

Uploaded
author fubar
date Sun, 04 Apr 2021 06:36:14 +0000
parents 56aa8105000d
children e8e8071c9d0c
files toolfactory/rgToolFactory2.py toolfactory/rgToolFactory2.xml
diffstat 2 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/toolfactory/rgToolFactory2.py	Tue Mar 30 02:51:51 2021 +0000
+++ b/toolfactory/rgToolFactory2.py	Sun Apr 04 06:36:14 2021 +0000
@@ -20,6 +20,7 @@
 import logging
 import os
 import re
+import shlex
 import shutil
 import subprocess
 import sys
@@ -191,8 +192,10 @@
             aCL(self.sfile)
             aXCL("$runme")
         else:
-            aCL(self.executeme[0])
-            aXCL(self.executeme[0])
+            for ex in self.executeme:
+                aCL(ex)
+                aXCL(ex)
+
         self.elog = os.path.join(self.repdir, "%s_error_log.txt" % self.tool_name)
         self.tlog = os.path.join(self.repdir, "%s_runner_log.txt" % self.tool_name)
         if self.args.parampass == "0":
@@ -204,8 +207,8 @@
             else:
                 self.prepargp()
                 self.clargparse()
-        if self.args.cl_prefix:  # DIY CL end - misnamed!
-            clp = self.args.cl_prefix.split(" ")
+        if self.args.cl_suffix:  # DIY CL end
+            clp = shlex.split(self.args.cl_suffix)
             for c in clp:
                 aCL(c)
                 aXCL(c)
@@ -398,6 +401,9 @@
                 k = "--%s" % k
             aCL(k)
             aCL(v)
+        if self.lastxclredirect:
+            aXCL(self.lastxclredirect[0])
+            aXCL(self.lastxclredirect[1])
 
     def getNdash(self, newname):
         if self.is_positional:
@@ -598,7 +604,7 @@
             )
             collect.append(disc)
             self.toutputs.append(collect)
-            tparm = gxtp.TestOutput(newname, ftype="pdf")
+            tparm = gxtp.TestOutputCollection(newname)
             self.testparam.append(tparm)
 
     def doNoXMLparam(self):
@@ -1036,7 +1042,7 @@
     a = parser.add_argument
     a("--script_path", default=None)
     a("--history_test", default=None)
-    a("--cl_prefix", default=None)
+    a("--cl_suffix", default=None)
     a("--sysexe", default=None)
     a("--packages", default=None)
     a("--tool_name", default="newtool")
--- a/toolfactory/rgToolFactory2.xml	Tue Mar 30 02:51:51 2021 +0000
+++ b/toolfactory/rgToolFactory2.xml	Sun Apr 04 06:36:14 2021 +0000
@@ -192,8 +192,8 @@
 python3 $__tool_directory__/rgToolFactory2.py --bad_user $__user_email__
  #else:
 python3 $__tool_directory__/rgToolFactory2.py
-    #if len(str($cl_prefix)) > 3:
---cl_prefix "$cl_prefix"
+    #if len(str($cl_suffix)) > 0:
+--cl_suffix "$cl_suffix"
     #end if
     #if $cover.commover == "yes":
        #if len(str($cover.command_override)) > 10:
@@ -358,8 +358,13 @@
         </when>
     </conditional>
     </section>
-    <param name="cl_prefix" type="text" value="" label="Suffix for generated command line. Useful for bash post processing. Use override below to replace completely"
-            help="';' separated bash commands can be used here for post processing - added at end of autogenerated command line" />
+    <param name="cl_suffix" type="text" value="" label="Suffix for generated command line. Useful for bash post processing. Use override below to replace completely"
+            help="';' separated bash commands can be used here for post processing - added at end of autogenerated command line">
+            <sanitizer>
+                 <valid initial="string.printable" />
+                 <mapping initial="none"/>
+            </sanitizer>
+    </param>
     <conditional name="cover">
         <param name="commover" type="select" display="radio" label="Add Human wrought code to override the generated XML command and/or test section - DIY"
         help = "For arbitrary and artfull command lines. All i/o and parameters must be passed. Choose No unless needed. Not for the faint of heart">