hgbook

diff en/examples/run-example @ 24:a752b0fd3c10

Merge.
author Bryan O'Sullivan <bos@serpentine.com>
date Sun Jul 09 21:47:15 2006 -0700 (2006-07-09)
parents 5ad16196cef4 187702df428b
children 5cee64874312
line diff
     1.1 --- a/en/examples/run-example	Sun Jul 09 21:29:19 2006 -0700
     1.2 +++ b/en/examples/run-example	Sun Jul 09 21:47:15 2006 -0700
     1.3 @@ -76,6 +76,7 @@
     1.4          rcfp = open(rcfile, 'w')
     1.5          print >> rcfp, 'PS1="%s"' % self.prompt
     1.6          print >> rcfp, 'unset HISTFILE'
     1.7 +        print >> rcfp, 'export EXAMPLE_DIR="%s"' % os.getcwd()
     1.8          print >> rcfp, 'export LANG=C'
     1.9          print >> rcfp, 'export LC_ALL=C'
    1.10          print >> rcfp, 'export TZ=GMT'
    1.11 @@ -118,7 +119,7 @@
    1.12                          if nl: hunk += '\n'
    1.13                      ofp.write(hunk)
    1.14                      # then its output
    1.15 -                    ofp.write(output)
    1.16 +                    ofp.write(tex_escape(output))
    1.17              self.status('\n')
    1.18          finally:
    1.19              try:
    1.20 @@ -141,7 +142,9 @@
    1.21      for name in os.listdir(path):
    1.22          if name == 'run-example' or name.startswith('.'): continue
    1.23          if name.endswith('.out') or name.endswith('~'): continue
    1.24 -        example(os.path.join(path, name)).run()
    1.25 +        pathname = os.path.join(path, name)
    1.26 +        if os.path.isfile(pathname):
    1.27 +            example(pathname).run()
    1.28      print >> open(os.path.join(path, '.run'), 'w'), time.asctime()
    1.29  
    1.30  if __name__ == '__main__':