INNER CODE UNIT · Python
open_w
theyosh/TerrariumPI · contrib/pipes/__init__.py:170
def open_w(self, file):
if not self.steps:
return open(file, "w")
if self.steps[0][1] == SOURCE:
raise ValueError("Template.open_w: pipeline begins with SOURCE")
cmd = self.makepipeline("", file)
return os.popen(cmd, "w")
def copy(self, infile, outfile):
return os.system(self.makepipeline(infile, outfile))
def makepipeline(self, infile, outfile):
cmd = makepipeline(infile, self.steps, outfile)
if self.debugging:
print(cmd)
cmd = "set -x; " + cmd
return cmd