17 |
else: |
else: |
18 |
return 1 |
return 1 |
19 |
return None |
return None |
20 |
|
|
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 |
|
# run the epydoc script |
39 |
|
if not os.system(runepydoc): |
40 |
|
os.chdir(pwd) |
41 |
|
open(str(target[0]), 'w').write("Documentation built\n") |
42 |
|
else: |
43 |
|
return 1 |
44 |
|
return None |
45 |
|
|
46 |
|
# build doxygen docs |
47 |
|
def build_doxygen(target, source, env): |
48 |
|
# get where I am currently, just as a reference |
49 |
|
pwd = os.getcwd() |
50 |
|
|
51 |
|
# get the full path of the rundoxygen script |
52 |
|
rundoxygen = str(source[0].abspath) |
53 |
|
|
54 |
|
# use this path to work out where the doc directory is |
55 |
|
dirs = rundoxygen.split('/') |
56 |
|
dirs = dirs[:-2] # trim the last two entries: this is now the doc dir path |
57 |
|
docdir = '/'.join(dirs) # this is the backwards python way to do it |
58 |
|
# (I'm feeling in a perl mood today...) |
59 |
|
|
60 |
|
# change into the relevant dir |
61 |
|
os.chdir(docdir) |
62 |
|
|
63 |
|
# run the doxygen script |
64 |
|
if not os.system(rundoxygen): |
65 |
|
os.chdir(pwd) |
66 |
|
open(str(target[0]), 'w').write("Documentation built\n") |
67 |
|
else: |
68 |
|
return 1 |
69 |
|
return None |