-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
pavement.py
91 lines (80 loc) · 2.53 KB
/
pavement.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from runestone.server import get_dburl
from sphinxcontrib import paverutils
import pkg_resources
from socket import gethostname
sys.path.append(os.getcwd())
home_dir = os.getcwd()
project_name = "instructorguide"
master_url = None
doctrees = None
if master_url is None:
if gethostname() in ["web407.webfaction.com", "rsbuilder"]:
master_url = "http://interactivepython.org"
if os.path.exists("../../custom_courses/{}".format(project_name)):
doctrees = "../../custom_courses/{}/doctrees".format(project_name)
else:
doctrees = "./build/{}/doctrees".format(project_name)
else:
master_url = "http://127.0.0.1:8000"
doctrees = "./build/{}/doctrees".format(project_name)
dynamic_pages = True
master_app = "runestone"
serving_dir = "./build/instructorguide"
if dynamic_pages:
dest = "./published"
else:
dest = "../../static"
options(
sphinx=Bunch(
docroot=".",
),
build=Bunch(
builddir="./build/instructorguide",
sourcedir="_sources",
outdir="./build/instructorguide",
confdir=".",
project_name=project_name,
template_args={
"course_id": "instructorguide",
"login_required": "false",
"appname": master_app,
"dynamic_pages": dynamic_pages,
"loglevel": 10,
"course_url": master_url,
"use_services": "false",
"python3": "true",
"dburl": "",
"basecourse": "instructorguide",
"downloads_enabled": "false",
"default_ac_lang": "python",
"enable_chatcodes": "false",
"allow_pairs": "false",
},
),
)
version = pkg_resources.require("runestone")[0].version
options.build.template_args["runestone_version"] = version
# p If DBUSER etc. are in the environment override dburl
# options.build.template_args["dburl"] = get_dburl(outer=locals())
from runestone import build # build is called implicitly by the paver driver.
template_args = {
"course_id": "instructorguide",
"login_required": "false",
"appname": master_app,
"dynamic_pages": dynamic_pages,
"loglevel": 10,
"course_url": master_url,
"use_services": "false",
"python3": "true",
"dburl": "",
"basecourse": "instructorguide",
"downloads_enabled": "false",
"default_ac_lang": "python",
"enable_chatcodes": "false",
"allow_pairs": "false",
}