Changeset 3359


Ignore:
Timestamp:
Jul 18, 2006, 4:49:34 PM (18 years ago)
Author:
jack
Message:

SCons will now byte-compile any .py files found.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • SConstruct

    r3353 r3359  
    11import os
    22import sys
     3import py_compile
     4
     5# Function to build a .pyc from a .py
     6def build_pyc(target, source, env):
     7    py_compile.compile(str(source[0]), str(target[0]), doraise=True)
     8    return None
    39
    410# Read in build options
     
    713opts.Add('MSVCFLAGS', 'Flags passed to the MSVC compiler')
    814
     15# Create the .pyc builder
     16pyc_builder = Builder(action = build_pyc,
     17                      suffix = '.pyc',
     18                      src_suffix = '.py')
     19
    920env = Environment(options = opts)
     21env.Append(BUILDERS={'Pyc' : pyc_builder})
    1022
    1123Help(opts.GenerateHelpText(env))
     
    4860Export('env')
    4961
     62# Build .pyc files of every .py in here and below.
     63files = []
     64dirs = filter(os.path.isdir, os.listdir('.'))
     65while(dirs != []):
     66    dirs += filter(os.path.isdir, map(lambda x : dirs[0] + os.sep + x, os.listdir(dirs[0])))
     67    files += filter(lambda x : x[-3:] == '.py', map(lambda x : dirs[0] + os.sep + x, os.listdir(dirs[0])))
     68    dirs = dirs[1:]
     69for x in files:
     70    env.Pyc(x + 'c', x)
     71
    5072SConscript(['inundation/SConscript'])
  • inundation-numpy-branch/pyvolution/netherlands-chris.py

    r1290 r3359  
    9797N = 60
    9898
    99 <<<<<<< .mine
    10099N = 4
    101 =======
    102100#N = 140
    103 >>>>>>> .r817
    104 
    105101#N = 15
    106102
  • inundation/pyvolution/netherlands-chris.py

    r1290 r3359  
    9797N = 60
    9898
    99 <<<<<<< .mine
    10099N = 4
    101 =======
    102100#N = 140
    103 >>>>>>> .r817
    104 
    105101#N = 15
    106102
  • production/merimbula_2005/run_merimbula_lake_weed.py

    r2622 r3359  
    5252    for i in range(n):
    5353    #print i
    54     z.append([0,0])
     54        z.append([0,0])
    5555        z[i][0] = 755471.4 + (points[i][0] + 3250.)/1.125
    5656        z[i][1] = 5910260.0 + (points[i][1] + 1337.)/1.12
Note: See TracChangeset for help on using the changeset viewer.