Mercurial > 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, 17 Jul 2006 00:00:12 -0700 |
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 |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/en/examples/run-example Sun Jul 16 23:29:29 2006 -0400 +++ b/en/examples/run-example Mon Jul 17 00:00:12 2006 -0700 @@ -10,6 +10,7 @@ import re import shutil import signal +import stat import sys import tempfile import time @@ -143,7 +144,8 @@ if name == 'run-example' or name.startswith('.'): continue if name.endswith('.out') or name.endswith('~'): continue pathname = os.path.join(path, name) - if os.path.isfile(pathname): + st = os.lstat(pathname) + if stat.S_ISREG(st.st_mode) and st.st_mode & 0111: example(pathname).run() print >> open(os.path.join(path, '.run'), 'w'), time.asctime()