diff en/examples/run-example @ 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 a752b0fd3c10
children 6b7b0339e7d6
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()