/[ascend]/trunk/models/SConscript
ViewVC logotype

Diff of /trunk/models/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2104 by jpye, Tue Apr 28 09:30:57 2009 UTC revision 2105 by jpye, Thu Dec 3 02:55:53 2009 UTC
# Line 7  env.SConscript(['test/SConscript'],['env Line 7  env.SConscript(['test/SConscript'],['env
7  env.SConscript(['sensitivity/SConscript'],['env'])  env.SConscript(['sensitivity/SConscript'],['env'])
8    
9  # Hunt for all models in the directory structure  # Hunt for all models in the directory structure
10  import os, os.path  import os, os.path, re
11    
12  modelfiles = []  modelfiles = []
13    
14  excludedirs = ['.svn','CVS']  excludedirs = ['.svn','CVS']
15  excludefiles = ['Makefile.in','SConscript','update-Makefile.pl']  excludefiles = ['Makefile.in','SConscript','SConstruct','update-Makefile.pl']
16    excludepatterns = [re.compile(s) for s in [
17        r"^.*\.os$"
18        , r"^.*\.o$"
19        ,r"^.*\.tm2$"
20        ,r"^.*/fprops/[a-z]+$"
21        ,r"^.*/fprops/.*\.c$"
22        ,r"^.*/fprops/.*\.h$"
23        ,r"^.*/fprops/test\.py$"
24        ,r"^.*/fprops/.*\.mac$"
25        ,r"^.*/fprops/precalc\.py$"
26        ,r"^.*/fprops/.*\.ods$"
27        ,r"^.*/fprops/python/.*$"
28    ]]
29    
30  modeldir = env.Dir(".").abspath  modeldir = env.Dir(".").abspath
31  #print "MODEL DIR =",modeldir  #print "MODEL DIR =",modeldir
# Line 37  for root,dirs,files in os.walk("."): Line 50  for root,dirs,files in os.walk("."):
50      for f in files:      for f in files:
51          if f in excludefiles:          if f in excludefiles:
52              continue              continue
53    
54            np = os.path.normpath(os.path.join(root,f))
55    
56            fail = False
57            for r in excludepatterns:
58                if r.match(np):
59                    fail = True
60                    break
61            if fail:
62                continue
63    
64          #print "ADDING",os.path.normpath(os.path.join(root,f))          #print "ADDING",os.path.normpath(os.path.join(root,f))
65          modelfiles.append( os.path.normpath(os.path.join(root,f)) )          modelfiles.append(np)
66  os.chdir(cwd)  os.chdir(cwd)
67    
68  #print "CWD =",cwd  #print "CWD =",cwd

Legend:
Removed from v.2104  
changed lines
  Added in v.2105

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22