Mercurial > repos > fubar > tool_factory_2
comparison toolfactory/rgToolFactory2.py @ 129:c35ff02652bf draft
Uploaded
author | fubar |
---|---|
date | Sun, 04 Apr 2021 06:36:14 +0000 |
parents | 98c8a76b3638 |
children | e8e8071c9d0c |
comparison
equal
deleted
inserted
replaced
128:56aa8105000d | 129:c35ff02652bf |
---|---|
18 import copy | 18 import copy |
19 import json | 19 import json |
20 import logging | 20 import logging |
21 import os | 21 import os |
22 import re | 22 import re |
23 import shlex | |
23 import shutil | 24 import shutil |
24 import subprocess | 25 import subprocess |
25 import sys | 26 import sys |
26 import tarfile | 27 import tarfile |
27 import tempfile | 28 import tempfile |
189 aCL(ex) | 190 aCL(ex) |
190 aXCL(ex) | 191 aXCL(ex) |
191 aCL(self.sfile) | 192 aCL(self.sfile) |
192 aXCL("$runme") | 193 aXCL("$runme") |
193 else: | 194 else: |
194 aCL(self.executeme[0]) | 195 for ex in self.executeme: |
195 aXCL(self.executeme[0]) | 196 aCL(ex) |
197 aXCL(ex) | |
198 | |
196 self.elog = os.path.join(self.repdir, "%s_error_log.txt" % self.tool_name) | 199 self.elog = os.path.join(self.repdir, "%s_error_log.txt" % self.tool_name) |
197 self.tlog = os.path.join(self.repdir, "%s_runner_log.txt" % self.tool_name) | 200 self.tlog = os.path.join(self.repdir, "%s_runner_log.txt" % self.tool_name) |
198 if self.args.parampass == "0": | 201 if self.args.parampass == "0": |
199 self.clsimple() | 202 self.clsimple() |
200 else: | 203 else: |
202 self.prepclpos() | 205 self.prepclpos() |
203 self.clpositional() | 206 self.clpositional() |
204 else: | 207 else: |
205 self.prepargp() | 208 self.prepargp() |
206 self.clargparse() | 209 self.clargparse() |
207 if self.args.cl_prefix: # DIY CL end - misnamed! | 210 if self.args.cl_suffix: # DIY CL end |
208 clp = self.args.cl_prefix.split(" ") | 211 clp = shlex.split(self.args.cl_suffix) |
209 for c in clp: | 212 for c in clp: |
210 aCL(c) | 213 aCL(c) |
211 aXCL(c) | 214 aXCL(c) |
212 | 215 |
213 def clsimple(self): | 216 def clsimple(self): |
396 k = "-%s" % k | 399 k = "-%s" % k |
397 else: | 400 else: |
398 k = "--%s" % k | 401 k = "--%s" % k |
399 aCL(k) | 402 aCL(k) |
400 aCL(v) | 403 aCL(v) |
404 if self.lastxclredirect: | |
405 aXCL(self.lastxclredirect[0]) | |
406 aXCL(self.lastxclredirect[1]) | |
401 | 407 |
402 def getNdash(self, newname): | 408 def getNdash(self, newname): |
403 if self.is_positional: | 409 if self.is_positional: |
404 ndash = 0 | 410 ndash = 0 |
405 else: | 411 else: |
596 disc = gxtp.DiscoverDatasets( | 602 disc = gxtp.DiscoverDatasets( |
597 pattern=newdisc, directory=f"{newname}", visible="false" | 603 pattern=newdisc, directory=f"{newname}", visible="false" |
598 ) | 604 ) |
599 collect.append(disc) | 605 collect.append(disc) |
600 self.toutputs.append(collect) | 606 self.toutputs.append(collect) |
601 tparm = gxtp.TestOutput(newname, ftype="pdf") | 607 tparm = gxtp.TestOutputCollection(newname) |
602 self.testparam.append(tparm) | 608 self.testparam.append(tparm) |
603 | 609 |
604 def doNoXMLparam(self): | 610 def doNoXMLparam(self): |
605 """filter style package - stdin to stdout""" | 611 """filter style package - stdin to stdout""" |
606 if len(self.infiles) > 0: | 612 if len(self.infiles) > 0: |
1034 """ | 1040 """ |
1035 parser = argparse.ArgumentParser() | 1041 parser = argparse.ArgumentParser() |
1036 a = parser.add_argument | 1042 a = parser.add_argument |
1037 a("--script_path", default=None) | 1043 a("--script_path", default=None) |
1038 a("--history_test", default=None) | 1044 a("--history_test", default=None) |
1039 a("--cl_prefix", default=None) | 1045 a("--cl_suffix", default=None) |
1040 a("--sysexe", default=None) | 1046 a("--sysexe", default=None) |
1041 a("--packages", default=None) | 1047 a("--packages", default=None) |
1042 a("--tool_name", default="newtool") | 1048 a("--tool_name", default="newtool") |
1043 a("--tool_dir", default=None) | 1049 a("--tool_dir", default=None) |
1044 a("--input_files", default=[], action="append") | 1050 a("--input_files", default=[], action="append") |