# HG changeset patch # User Bryan O'Sullivan # Date 1238527102 25200 # Node ID c82ff69f0935062cbf1820d3896e1f554a4262af # Parent c17f8bffc9e50022296d3ce507616dd743cf6371 Add markers to flag included snippets of code. diff -r c17f8bffc9e5 -r c82ff69f0935 en/examples/run-example --- a/en/examples/run-example Tue Mar 31 09:04:23 2009 -0700 +++ b/en/examples/run-example Tue Mar 31 12:18:22 2009 -0700 @@ -127,9 +127,11 @@ s = open(self.name).read().rstrip() s = s.replace('&', '&').replace('<', '<').replace('>', '>') ofp = wopen(result_name(self.name + '.tmp')) + ofp.write('\n' % self.name) ofp.write('') ofp.write(s) ofp.write('\n') + ofp.write('\n' % self.name) ofp.close() self.rename_output(self.name) norm = self.name.replace(os.sep, '-') @@ -309,6 +311,7 @@ assert os.sep not in out if ofp is not None: ofp.write('\n') + ofp.write('\n' % ofp_basename) ofp.close() err |= self.rename_output(ofp_basename, ignore) if out: @@ -320,6 +323,7 @@ % (norm, norm)] = 1 read_hint = ofp_basename + ' ' ofp = wopen(result_name(ofp_basename + '.tmp')) + ofp.write('\n' % ofp_basename) ofp.write('') else: ofp = None @@ -333,7 +337,8 @@ # first, print the command we ran if not hunk.startswith('#'): nl = hunk.endswith('\n') - hunk = ('%s %s' % + hunk = ('%s ' + '%s' % (prompts[ps], xml_escape(hunk.rstrip('\n')))) if nl: hunk += '\n' @@ -353,6 +358,7 @@ if ofp is not None: ofp.write(output) ofp.write('\n') + ofp.write('\n' % ofp_basename) ofp.close() err |= self.rename_output(ofp_basename, ignore) os.close(self.cfd) @@ -379,7 +385,7 @@ print >> sys.stderr, 'Options:' print >> sys.stderr, ' -a --all run all examples in this directory' print >> sys.stderr, ' -h --help print this help message' - print >> sys.stderr, ' --help keep new output as desired output' + print >> sys.stderr, ' --keep keep new output as desired output' print >> sys.stderr, ' -v --verbose display extra debug output' sys.exit(exit)