- Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathpavement.py
More file actions
Latest commit
executable file
·106 lines (91 loc) · 2.74 KB
/
Copy pathpavement.py
File metadata and controls
executable file
·106 lines (91 loc) · 2.74 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
importpaver
frompaver.easyimport*
importpaver.setuputils
paver.setuputils.install_distutils_tasks()
fromosimportenviron, getcwd
importos.path
importsys
fromsocketimportgethostname
importpkg_resources
fromrunestoneimportget_master_url
sys.path.append(getcwd())
sys.path.append("../modules")
updateProgressTables=True
try:
fromrunestone.server.chapternamesimportpopulateChapterInfob
exceptImportError:
updateProgressTables=False
######## CHANGE THIS ##########
project_name="cpp4python"
###############################
master_url=None
doctrees="./build/{}/doctrees".format(project_name)
dynamic_pages=True
ifmaster_urlisNone:
master_url=get_master_url()
master_app="runestone"
serving_dir="./build/"+project_name
dest="./published"
options(
sphinx=Bunch(
docroot=".",
),
build=Bunch(
builddir="./build/"+project_name,
sourcedir="./_sources/",
outdir="./build/"+project_name,
confdir=".",
project_name=project_name,
doctrees=doctrees,
template_args={
"course_id": project_name,
"course_title": "C++\\ for\\ Python\\ Programmers",
"login_required": "false",
"appname": master_app,
"loglevel": 10,
"course_url": master_url,
"use_services": "true",
"python3": "true",
"dynamic_pages": dynamic_pages,
"dburl": "postgresql://bmiller@localhost/runestone",
"basecourse": "thinkcspy",
"downloads_enabled": "false",
"default_ac_lang": "python",
"enable_chatcodes": "false",
"allow_pairs": "false",
},
),
)
ifproject_name=="<project_name>":
print("Please edit pavement.py and give your project a name")
exit()
version=pkg_resources.require("runestone")[0].version
options.build.template_args["runestone_version"] =version
if (
"DBHOST"inenviron
and"DBPASS"inenviron
and"DBUSER"inenviron
and"DBNAME"inenviron
):
options.build.template_args[
"dburl"
] ="postgresql://{DBUSER}:{DBPASS}@{DBHOST}/{DBNAME}".format(**environ)
fromrunestoneimportbuild
# build is called implicitly by the paver driver.
template_args= {
"course_id": project_name,
"course_title": "C++\\ for\\ Python\\ Programmers",
"login_required": "false",
"appname": master_app,
"loglevel": 10,
"course_url": master_url,
"use_services": "true",
"python3": "true",
"dynamic_pages": dynamic_pages,
"dburl": "postgresql://bmiller@localhost/runestone",
"basecourse": "thinkcspy",
"downloads_enabled": "false",
"default_ac_lang": "python",
"enable_chatcodes": "false",
"allow_pairs": "false",
}