hgbook
changeset 36:5cee64874312
Require examples to be executable, so it's easier to see them with "ls".
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Jul 17 00:00:12 2006 -0700 (2006-07-17) |
parents | e68f4a96c16e |
children | 9fd0c59b009a |
files | en/examples/hook.simple en/examples/mq.diff en/examples/mq.qinit-help en/examples/mq.tarball en/examples/mq.tools en/examples/mq.tutorial en/examples/run-example |
line diff
1.1 --- a/en/examples/run-example Sun Jul 16 23:29:29 2006 -0400 1.2 +++ b/en/examples/run-example Mon Jul 17 00:00:12 2006 -0700 1.3 @@ -10,6 +10,7 @@ 1.4 import re 1.5 import shutil 1.6 import signal 1.7 +import stat 1.8 import sys 1.9 import tempfile 1.10 import time 1.11 @@ -143,7 +144,8 @@ 1.12 if name == 'run-example' or name.startswith('.'): continue 1.13 if name.endswith('.out') or name.endswith('~'): continue 1.14 pathname = os.path.join(path, name) 1.15 - if os.path.isfile(pathname): 1.16 + st = os.lstat(pathname) 1.17 + if stat.S_ISREG(st.st_mode) and st.st_mode & 0111: 1.18 example(pathname).run() 1.19 print >> open(os.path.join(path, '.run'), 'w'), time.asctime() 1.20