Mercurial > pymonkey
annotate manage.py @ 51:fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Wed, 08 Jul 2009 09:32:31 -0700 |
parents | 7401af070bb8 |
children | 3570ab12747b |
rev | line source |
---|---|
25
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
1 #! /usr/bin/env python |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
2 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
3 import os |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
4 import sys |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
5 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
6 if __name__ == '__main__': |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
7 # This code is run if we're executed directly from the command-line. |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
8 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
9 myfile = os.path.abspath(__file__) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
10 mydir = os.path.dirname(myfile) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
11 sys.path.insert(0, os.path.join(mydir, 'python-modules')) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
12 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
13 args = sys.argv[1:] |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
14 if not args: |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
15 args = ['help'] |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
16 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
17 # Have paver run this very file as its pavement script. |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
18 args = ['-f', myfile] + args |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
19 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
20 import paver.tasks |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
21 paver.tasks.main(args) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
22 sys.exit(0) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
23 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
24 # This code is run if we're executed as a pavement script by paver. |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
25 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
26 import os |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
27 import subprocess |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
28 import shutil |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
29 import sys |
49
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
30 import webbrowser |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
31 import urllib |
25
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
32 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
33 from paver.easy import * |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
34 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
35 @task |
49
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
36 def docs(options): |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
37 """Open the Pymonkey documentation in your web browser.""" |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
38 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
39 url = os.path.abspath(os.path.join("docs", "rendered", "index.html")) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
40 url = urllib.pathname2url(url) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
41 webbrowser.open(url) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
42 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
43 @task |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
44 def build_docs(options): |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
45 """Build the Pymonkey documentation (requires Sphinx).""" |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
46 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
47 retval = subprocess.call(["sphinx-build", |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
48 "-b", "html", |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
49 os.path.join("docs", "src"), |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
50 os.path.join("docs", "rendered")]) |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
51 if retval: |
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
52 sys.exit(retval) |
49
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
53 |
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
54 @task |
35
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
55 @cmdopts([("objdir=", "o", "The root of your Mozilla objdir"), |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
56 ("static", "s", "Build against static libraries")]) |
25
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
57 def build(options): |
49
7401af070bb8
Moved README to Sphinx documentation. Keeping the rendered docs in the repository so that they can be viewed via HG and locally by people who don't have Sphinx installed.
Atul Varma <varmaa@toolness.com>
parents:
37
diff
changeset
|
58 """Build the Pymonkey Python C extension.""" |
25
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
59 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
60 objdir = options.get("objdir") |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
61 if not objdir: |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
62 print("Objdir not specified! Please specify one with " |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
63 "the --objdir option.") |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
64 sys.exit(1) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
65 objdir = os.path.abspath(objdir) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
66 incdir = os.path.join(objdir, "dist", "include") |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
67 libdir = os.path.join(objdir, "dist", "lib") |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
68 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
69 print "Building extension." |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
70 |
35
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
71 args = ["g++", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
72 "-framework", "Python", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
73 "-I%s" % incdir, |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
74 "-L%s" % libdir, |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
75 "-Wall", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
76 "-o", "pymonkey.so", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
77 "-dynamiclib", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
78 "pymonkey.c", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
79 "utils.c", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
80 "object.c", |
37
d4efcbb06964
Added a new PYM_JSFunction type, PYM_JSContext.define_property(), and PYM_JSContext.new_function(). Also fixed a memory leak.
Atul Varma <varmaa@toolness.com>
parents:
35
diff
changeset
|
81 "function.c", |
35
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
82 "undefined.c", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
83 "context.c", |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
84 "runtime.c"] |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
85 |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
86 if options.get("static"): |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
87 args.append(os.path.join(objdir, "libjs_static.a")) |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
88 else: |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
89 args.append("-lmozjs") |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
90 |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
91 result = subprocess.call(args) |
25
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
92 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
93 if result: |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
94 sys.exit(result) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
95 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
96 print "Running test suite." |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
97 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
98 new_env = {} |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
99 new_env.update(os.environ) |
35
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
100 if not options.get("static"): |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
101 print("NOTE: Because you're linking dynamically to the " |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
102 "SpiderMonkey shared library, you'll need to make sure " |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
103 "that it's on your library load path. You may need to " |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
104 "add %s to your library load path to do this." % |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
105 libdir) |
3e66613d1d4d
Added information about getting my SpiderMonkey mirror, and also added an option for linking statically to SpiderMonkey's runtime instead of dynamically.
Atul Varma <varmaa@toolness.com>
parents:
31
diff
changeset
|
106 new_env['DYLD_LIBRARY_PATH'] = libdir |
25
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
107 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
108 result = subprocess.call( |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
109 [sys.executable, |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
110 "test_pymonkey.py"], |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
111 env = new_env |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
112 ) |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
113 |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
114 if result: |
3c2151124cee
Converted pavement.py to manage.py and added a README.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
115 sys.exit(result) |
51
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
116 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
117 print "Running doctests." |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
118 |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
119 # We have to add our current directory to the python path so that |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
120 # our doctests can find the pymonkey module. |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
121 new_env['PYTHONPATH'] = os.path.abspath('.') |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
122 retval = subprocess.call(["sphinx-build", |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
123 "-b", "doctest", |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
124 os.path.join("docs", "src"), |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
125 "_doctest_output"], |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
126 env = new_env) |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
127 if retval: |
fabd3f2271fa
Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
49
diff
changeset
|
128 sys.exit(retval) |