Mercurial > repos > fubar > tool_factory_2
diff rgToolFactory2.py @ 4:b85a3b92e9f7 draft
Uploaded
author | fubar |
---|---|
date | Sun, 11 Jan 2015 23:03:00 -0500 |
parents | d75fd880fce2 |
children | e9c858c8aa6e |
line wrap: on
line diff
--- a/rgToolFactory2.py Sun Jan 11 22:01:27 2015 -0500 +++ b/rgToolFactory2.py Sun Jan 11 23:03:00 2015 -0500 @@ -190,15 +190,15 @@ self.myname = sys.argv[0] # get our name because we write ourselves out as a tool later self.pyfile = self.myname # crude but efficient - the cruft won't hurt much self.xmlfile = '%s.xml' % self.toolname - s = open(self.opts.script_path,'r').readlines() - s = [x.rstrip() for x in s] # remove pesky dos line endings if needed - self.script = '\n'.join(s) + rx = open(self.opts.script_path,'r').readlines() + rx = [x.rstrip() for x in rx] # remove pesky dos line endings if needed + self.script = '\n'.join(rx) fhandle,self.sfile = tempfile.mkstemp(prefix=self.toolname,suffix=".%s" % (opts.interpreter)) tscript = open(self.sfile,'w') # use self.sfile as script source for Popen tscript.write(self.script) tscript.close() - self.indentedScript = '\n'.join([' %s' % html_escape(x) for x in s]) # for restructured text in help - self.escapedScript = '\n'.join([html_escape(x) for x in s]) + self.indentedScript = "<![CDATA[%s]]>" % '\n'.join([' %s' % x for x in rx]) # for restructured text in help + self.escapedScript = "<![CDATA[%s]]>" % self.script) self.elog = os.path.join(self.opts.output_dir,"%s_error.log" % self.toolname) if opts.output_dir: # may not want these complexities self.tlog = os.path.join(self.opts.output_dir,"%s_runner.log" % self.toolname)