/[escript]/trunk/scons/scons_extensions.py
ViewVC logotype

Annotation of /trunk/scons/scons_extensions.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 486 - (hide annotations)
Thu Feb 2 05:23:44 2006 UTC (13 years, 6 months ago) by jgs
File MIME type: text/x-python
File size: 1994 byte(s)
define locations of doxygen/epydoc executables
1 jgs 268 # Extensions to Scons
2    
3     import py_compile
4     import sys
5 jgs 297 import os
6 jgs 268
7     # Code to build .pyc from .py
8     def build_py(target, source, env):
9     py_compile.compile(str(source[0]), str(target[0]))
10     return None
11 jgs 297
12     # Code to run unit_test executables
13     def runUnitTest(target, source, env):
14     app = str(source[0].abspath)
15     if not os.system(app):
16     open(str(target[0]),'w').write("PASSED\n")
17 jgs 359 else:
18     return 1
19 jgs 297 return None
20 cochrane 370
21     # code to build epydoc docs
22     def build_epydoc(target, source, env):
23     # get where I am currently, just as a reference
24     pwd = os.getcwd()
25    
26     # get the full path of the runepydoc script
27     runepydoc = str(source[0].abspath)
28    
29     # use this path to work out where the doc directory is
30     dirs = runepydoc.split('/')
31     dirs = dirs[:-3] # trim the last two entries: this is now the doc dir path
32     docdir = '/'.join(dirs) # this is the backwards python way to do it
33     # (I'm feeling in a perl mood today...)
34    
35     # change into the relevant dir
36     os.chdir(docdir)
37    
38 jgs 486 # determine which epydoc executable to use
39    
40 cochrane 370 # run the epydoc script
41     if not os.system(runepydoc):
42     os.chdir(pwd)
43     open(str(target[0]), 'w').write("Documentation built\n")
44     else:
45     return 1
46     return None
47    
48     # build doxygen docs
49     def build_doxygen(target, source, env):
50     # get where I am currently, just as a reference
51     pwd = os.getcwd()
52    
53     # get the full path of the rundoxygen script
54     rundoxygen = str(source[0].abspath)
55    
56     # use this path to work out where the doc directory is
57     dirs = rundoxygen.split('/')
58     dirs = dirs[:-2] # trim the last two entries: this is now the doc dir path
59     docdir = '/'.join(dirs) # this is the backwards python way to do it
60     # (I'm feeling in a perl mood today...)
61    
62     # change into the relevant dir
63     os.chdir(docdir)
64    
65 jgs 486 # determine which doxygen executable to use
66    
67 cochrane 370 # run the doxygen script
68     if not os.system(rundoxygen):
69     os.chdir(pwd)
70     open(str(target[0]), 'w').write("Documentation built\n")
71     else:
72     return 1
73     return None

  ViewVC Help
Powered by ViewVC 1.1.26