Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit fe691e3

Browse files
committed
Add default click param
* Fix: mkdir mode must be in octal
1 parent 05271fb commit fe691e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

runestone/server/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def process_manifest(cname, mpath, click=click):
155155
)
156156

157157

158-
def check_project_ptx():
158+
def check_project_ptx(click=click):
159159
"""
160160
Verify that the PreTeXt project is set up for a Runestone build
161161
@@ -185,7 +185,7 @@ def check_project_ptx():
185185
sys.exit(1)
186186

187187

188-
def extract_docinfo(tree, string, attr=None):
188+
def extract_docinfo(tree, string, attr=None, click=click):
189189
"""
190190
Parameters:
191191
tree: The parsed document tree from ET
@@ -203,7 +203,7 @@ def extract_docinfo(tree, string, attr=None):
203203
return ""
204204

205205

206-
def update_library(config, mpath, course):
206+
def update_library(config, mpath, course, click=click):
207207
"""
208208
Parameters:
209209
config : This originated as a config object from click -- a mock config will be provided by the AuthorServer
@@ -246,7 +246,7 @@ def update_library(config, mpath, course):
246246
)
247247

248248

249-
def populate_static(config, mpath: Path, course: str):
249+
def populate_static(config, mpath: Path, course: str, click=click):
250250
"""
251251
Copy the apropriate Javascript to the _static folder for PreTeXt books. This may
252252
involve downloading it from the Runestone CDN. PreTeXt does not include the current set
@@ -261,7 +261,7 @@ def populate_static(config, mpath: Path, course: str):
261261
tree = ET.parse(sdir / "webpack_static_imports.xml")
262262
current_version = tree.find("./version").text
263263
else:
264-
sdir.mkdir(mode=775, exist_ok=True)
264+
sdir.mkdir(mode=0o775, exist_ok=True) # NB mode must be in Octal!
265265
tree = ET.parse(mpath)
266266
el = tree.find("./runestone-services[@version]")
267267
version = el.attrib["version"].strip()

0 commit comments

Comments
 (0)