mirror of https://github.com/tLDP/python-tldp
add a postamble, too (extra newlines, only)
This commit is contained in:
parent
f112fc98d1
commit
62f96f3bcb
|
@ -21,6 +21,10 @@ set -o pipefail
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
postamble = '''
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
def depends(graph, *predecessors):
|
def depends(graph, *predecessors):
|
||||||
'''decorator to be used for constructing build order graph'''
|
'''decorator to be used for constructing build order graph'''
|
||||||
def anon(f):
|
def anon(f):
|
||||||
|
@ -72,7 +76,7 @@ class BaseDoctype(object):
|
||||||
assert validator(thing)
|
assert validator(thing)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def shellscript(self, script, preamble=preamble):
|
def shellscript(self, script, preamble=preamble, postamble=postamble):
|
||||||
source = self.source
|
source = self.source
|
||||||
output = self.output
|
output = self.output
|
||||||
config = self.config
|
config = self.config
|
||||||
|
@ -85,6 +89,8 @@ class BaseDoctype(object):
|
||||||
if preamble:
|
if preamble:
|
||||||
tf.write(preamble)
|
tf.write(preamble)
|
||||||
tf.write(s)
|
tf.write(s)
|
||||||
|
if postamble:
|
||||||
|
tf.write(postamble)
|
||||||
tf.close()
|
tf.close()
|
||||||
|
|
||||||
mode = stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR
|
mode = stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR
|
||||||
|
@ -93,6 +99,9 @@ class BaseDoctype(object):
|
||||||
cmd = [tf.name]
|
cmd = [tf.name]
|
||||||
result = execute(cmd, logdir=logdir)
|
result = execute(cmd, logdir=logdir)
|
||||||
if result != 0:
|
if result != 0:
|
||||||
|
with open(tf.name) as f:
|
||||||
|
for line in f:
|
||||||
|
logger.debug("Script: %s", line.rstrip())
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue