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

Changeset 109:0116bfe0fa5e (2020-11-29)
Previous changeset 108:e878bfc6b80c (2020-11-29) Next changeset 110:ab2474035f81 (2020-11-29)
Commit message:
Uploaded
modified:
toolfactory/rgToolFactory2.py
b
diff -r e878bfc6b80c -r 0116bfe0fa5e toolfactory/rgToolFactory2.py
--- 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()