/[escript]/trunk/site_scons/site_init.py
ViewVC logotype

Diff of /trunk/site_scons/site_init.py

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

revision 360 by jgs, Thu Dec 15 01:52:16 2005 UTC revision 707 by gross, Wed Apr 12 23:58:02 2006 UTC
# Line 1  Line 1 
1    
2    #          Copyright 2006 by ACcESS MNRF                  
3    #                                                          
4    #              http://www.access.edu.au                    
5    #       Primary Business: Queensland, Australia            
6    #  Licensed under the Open Software License version 3.0    
7    #     http://www.opensource.org/licenses/osl-3.0.php      
8    #                                                          
9    
10    
11  # Extensions to Scons  # Extensions to Scons
12    
13  import py_compile  import py_compile
# Line 12  def build_py(target, source, env): Line 22  def build_py(target, source, env):
22  # Code to run unit_test executables  # Code to run unit_test executables
23  def runUnitTest(target, source, env):  def runUnitTest(target, source, env):
24    app = str(source[0].abspath)    app = str(source[0].abspath)
25    if not os.system(app):    if not env.Execute(app):
26      open(str(target[0]),'w').write("PASSED\n")      open(str(target[0]),'w').write("PASSED\n")
27    else:    else:
28      return 1      return 1
29    return None    return None
30    
31    def runPyUnitTest(target, source, env):
32       app = 'python '+str(source[0].abspath)
33       if not env.Execute(app):
34          open(str(target[0]),'w').write("PASSED\n")
35       else:
36         return 1
37       return None
38    
39    
40    def build_epydoc(target, source, env):
41        # get where I am currently, just as a reference
42        pwd = os.getcwd()
43    
44        # get the full path of the runepydoc script
45        runepydoc = str(source[0].abspath)
46    
47        # use this path to work out where the doc directory is
48        dirs = runepydoc.split('/')
49        dirs = dirs[:-3] # trim the last two entries: this is now the doc dir path
50        docdir = '/'.join(dirs) # this is the backwards python way to do it
51        # (I'm feeling in a perl mood today...)
52    
53        # change into the relevant dir
54        os.chdir(docdir)
55    
56        # run the epydoc script
57        if not os.system(runepydoc):
58        os.chdir(pwd)
59        open(str(target[0]), 'w').write("Documentation built\n")
60        else:
61        return 1
62        return None
63    
64    # build doxygen docs
65    def build_doxygen(target, source, env):
66        # get where I am currently, just as a reference
67        pwd = os.getcwd()
68    
69        # get the full path of the rundoxygen script
70        rundoxygen = str(source[0].abspath)
71    
72        # use this path to work out where the doc directory is
73        dirs = rundoxygen.split('/')
74        dirs = dirs[:-2] # trim the last two entries: this is now the doc dir path
75        docdir = '/'.join(dirs) # this is the backwards python way to do it
76        # (I'm feeling in a perl mood today...)
77    
78        # change into the relevant dir
79        os.chdir(docdir)
80    
81        # run the doxygen script
82        if not os.system(rundoxygen):
83        os.chdir(pwd)
84        open(str(target[0]), 'w').write("Documentation built\n")
85        else:
86        return 1
87        return None

Legend:
Removed from v.360  
changed lines
  Added in v.707

  ViewVC Help
Powered by ViewVC 1.1.26