comparison toolfactory/rgToolFactory2.py @ 109:0116bfe0fa5e draft

Uploaded
author fubar
date Sun, 29 Nov 2020 04:49:52 +0000
parents e878bfc6b80c
children ab2474035f81
comparison
equal deleted inserted replaced
108:e878bfc6b80c 109:0116bfe0fa5e
293 prefix=self.tool_name, suffix="_%s" % (self.executeme) 293 prefix=self.tool_name, suffix="_%s" % (self.executeme)
294 ) 294 )
295 tscript = open(self.sfile, "w") 295 tscript = open(self.sfile, "w")
296 tscript.write(self.script) 296 tscript.write(self.script)
297 tscript.close() 297 tscript.close()
298 self.indentedScript = " %s" % "\n".join([" %s" % cheetah_escape(x) for x in rx]) 298 self.escapedScript = [cheetah_escape(x) for x in rx]
299 self.escapedScript = "%s" % "\n".join([" %s" % cheetah_escape(x) for x in rx])
300 art = "%s.%s" % (self.tool_name, self.executeme) 299 art = "%s.%s" % (self.tool_name, self.executeme)
301 artifact = open(art, "wb") 300 artifact = open(art, "wb")
302 artifact.write(bytes(self.escapedScript, "utf8")) 301 artifact.write(bytes(self.escapedScript, "utf8"))
303 artifact.close() 302 artifact.close()
304 303
572 self.newtool.command_override = self.xmlcl 571 self.newtool.command_override = self.xmlcl
573 if self.args.help_text: 572 if self.args.help_text:
574 helptext = open(self.args.help_text, "r").readlines() 573 helptext = open(self.args.help_text, "r").readlines()
575 safertext = "\n".join([cheetah_escape(x) for x in helptext]) 574 safertext = "\n".join([cheetah_escape(x) for x in helptext])
576 if self.args.script_path: 575 if self.args.script_path:
577 scr = self.script.split("\n") 576 scr = self.escapedScript
578 scrp = [cheetah_escape(x) for x in scr]
579 scrpt = [' %s' % x for x in scrpt if x.strip() > ''] # indent 577 scrpt = [' %s' % x for x in scrpt if x.strip() > ''] # indent
580 scrpt.insert(0,'------\n\nScript::\n') 578 scrpt.insert(0,'------\n\nScript::\n')
581 if len(scrpt) > 300: 579 if len(scrpt) > 300:
582 safertext = ( 580 safertext = (
583 safertext 581 safertext
613 self.doXMLparam() 611 self.doXMLparam()
614 self.newtool.outputs = self.toutputs 612 self.newtool.outputs = self.toutputs
615 self.newtool.inputs = self.tinputs 613 self.newtool.inputs = self.tinputs
616 if self.args.script_path: 614 if self.args.script_path:
617 configfiles = gxtp.Configfiles() 615 configfiles = gxtp.Configfiles()
618 configfiles.append(gxtp.Configfile(name="runme", text=self.escapedScript)) 616 configfiles.append(gxtp.Configfile(name="runme", text="\n".join(self.escapedScript)))
619 self.newtool.configfiles = configfiles 617 self.newtool.configfiles = configfiles
620 tests = gxtp.Tests() 618 tests = gxtp.Tests()
621 test_a = gxtp.Test() 619 test_a = gxtp.Test()
622 for tp in self.testparam: 620 for tp in self.testparam:
623 test_a.append(tp) 621 test_a.append(tp)