changeset 109:0116bfe0fa5e draft

Uploaded
author fubar
date Sun, 29 Nov 2020 04:49:52 +0000
parents e878bfc6b80c
children ab2474035f81
files toolfactory/rgToolFactory2.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/toolfactory/rgToolFactory2.py	Sun Nov 29 04:32:22 2020 +0000
+++ b/toolfactory/rgToolFactory2.py	Sun Nov 29 04:49:52 2020 +0000
@@ -295,8 +295,7 @@
         tscript = open(self.sfile, "w")
         tscript.write(self.script)
         tscript.close()
-        self.indentedScript = "  %s" % "\n".join([" %s" % cheetah_escape(x) for x in rx])
-        self.escapedScript = "%s" % "\n".join([" %s" % cheetah_escape(x) for x in rx])
+        self.escapedScript = [cheetah_escape(x) for x in rx]
         art = "%s.%s" % (self.tool_name, self.executeme)
         artifact = open(art, "wb")
         artifact.write(bytes(self.escapedScript, "utf8"))
@@ -574,8 +573,7 @@
             helptext = open(self.args.help_text, "r").readlines()
             safertext = "\n".join([cheetah_escape(x) for x in helptext])
             if self.args.script_path:
-                scr = self.script.split("\n")
-                scrp = [cheetah_escape(x) for x in scr]
+                scr = self.escapedScript
                 scrpt = ['    %s' % x for x in scrpt if x.strip() > ''] # indent
                 scrpt.insert(0,'------\n\nScript::\n')
                 if len(scrpt) > 300:
@@ -615,7 +613,7 @@
         self.newtool.inputs = self.tinputs
         if self.args.script_path:
             configfiles = gxtp.Configfiles()
-            configfiles.append(gxtp.Configfile(name="runme", text=self.escapedScript))
+            configfiles.append(gxtp.Configfile(name="runme", text="\n".join(self.escapedScript)))
             self.newtool.configfiles = configfiles
         tests = gxtp.Tests()
         test_a = gxtp.Test()