hgbook

diff en/examples/run-example @ 19:187702df428b

Piles of new content for MQ chapter - cookbook stuff.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri Jul 07 19:56:53 2006 -0700 (2006-07-07)
parents 69d90ab9fd80
children a752b0fd3c10
line diff
     1.1 --- a/en/examples/run-example	Mon Jun 26 10:15:49 2006 -0700
     1.2 +++ b/en/examples/run-example	Fri Jul 07 19:56:53 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 @@ -117,7 +118,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 @@ -140,7 +141,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__':