Skip to content
Snippets Groups Projects
Commit 8c2aba15 authored by tuhe's avatar tuhe
Browse files

removed

parents d4bee0aa 4eb97ecb
No related branches found
No related tags found
No related merge requests found
Showing
with 11 additions and 15 deletions
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -93,6 +93,10 @@ def build_sphinx_documentation(cut_files=False, open_browser=True, build_and_cop ...@@ -93,6 +93,10 @@ def build_sphinx_documentation(cut_files=False, open_browser=True, build_and_cop
# print(">>> k class is: ") # print(">>> k class is: ")
# print(info_paths.core_conf['projects_all'][k]) # print(info_paths.core_conf['projects_all'][k])
if "class" not in info_paths.core_conf['projects_all'][k]:
print(f"Warning: I was unable to find project with number {k}. Probably the class raise an Exception. ")
print(info_paths.core_conf['projects_all'][k])
f = info_paths.core_conf['projects_all'][k]['class'].mfile() f = info_paths.core_conf['projects_all'][k]['class'].mfile()
with open(f.split("_grade.py")[0], 'r') as ff: with open(f.split("_grade.py")[0], 'r') as ff:
l = [l for l in ff.read().splitlines() if "(Report)" in l].pop().split("(")[0].split(" ")[-1] l = [l for l in ff.read().splitlines() if "(Report)" in l].pop().split("(")[0].split(" ")[-1]
...@@ -232,12 +236,13 @@ def build_sphinx_documentation(cut_files=False, open_browser=True, build_and_cop ...@@ -232,12 +236,13 @@ def build_sphinx_documentation(cut_files=False, open_browser=True, build_and_cop
my_env['PYTHONPATH'] = (paths['02450students'] + '_complete').replace("\\", "/") my_env['PYTHONPATH'] = (paths['02450students'] + '_complete').replace("\\", "/")
print("Running", cmd) print("Running", cmd)
process = run(cmd, print_output=True, log_output=True, check=False, env=my_env) process = run(cmd, print_output=True, log_output=True, check=False, env=my_env)
print("Done running sphinx build command.")
"""r """r
cd /home/tuhe/Documents/02465students_complete/ && sphinx-build -b html docs/source ./public cd /home/tuhe/Documents/02465students_complete/ && sphinx-build -b html docs/source ./public
cd "/home/tuhe/Documents/02465students_complete/docs" && sphinx-build -b html source "../../02465public/public" -a cd "/home/tuhe/Documents/02465students_complete/docs" && sphinx-build -b html source "../../02465public/public" -a
""" """
if os.name == 'nt': if os.name == 'nt':
print("This is windows. Building again:")
process = run(cmd, print_output=True, log_output=True, check=False, env=my_env) process = run(cmd, print_output=True, log_output=True, check=False, env=my_env)
print("TH 2023 Juli: Running sphinx compilation job twice bc of path error on windows. This should be easy to fix but I don't know enough about windows to do so.") print("TH 2023 Juli: Running sphinx compilation job twice bc of path error on windows. This should be easy to fix but I don't know enough about windows to do so.")
print(process.stderr.getvalue()) print(process.stderr.getvalue())
...@@ -270,7 +275,7 @@ Below is a summary of the problems we found: """) ...@@ -270,7 +275,7 @@ Below is a summary of the problems we found: """)
for im in ["gb.png", "dk.png"]: for im in ["gb.png", "dk.png"]:
shutil.copy(f"{paths['shared']}/figures/{im}", f"{_FINAL_BUILD_DEST}/_images/{im}") shutil.copy(f"{paths['shared']}/figures/{im}", f"{_FINAL_BUILD_DEST}/_images/{im}")
print("Running and building censored version of files:")
if build_and_copy_censored: if build_and_copy_censored:
verbose = False verbose = False
setup_student_files(run_files=False, cut_files=False, censor_files=True, setup_lectures=cut_files, setup_student_files(run_files=False, cut_files=False, censor_files=True, setup_lectures=cut_files,
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -15,7 +15,8 @@ def setup_student_files(run_files=True, ...@@ -15,7 +15,8 @@ def setup_student_files(run_files=True,
week=None, extra_dirs=None, week=None, extra_dirs=None,
include_solutions=None, include_solutions=None,
projects=None, projects=None,
setup_lectures=False, strict=True, setup_lectures=False,
strict=True,
fix_shared_files=True, fix_shared_files=True,
include_exam_examples=False, # Include the directory with exam-related examples. include_exam_examples=False, # Include the directory with exam-related examples.
verbose=True, verbose=True,
...@@ -33,21 +34,11 @@ def setup_student_files(run_files=True, ...@@ -33,21 +34,11 @@ def setup_student_files(run_files=True,
from coursebox.core.info import class_information from coursebox.core.info import class_information
# info = class_information() # info = class_information()
from coursebox.core.info import core_conf from coursebox.core.info import core_conf
# <<<<<<< HEAD
# if 'package' not in core_conf:
if len(core_conf['projects_all']) > 0: if len(core_conf['projects_all']) > 0:
PACKAGE = list(core_conf['projects_all'].values()).pop()['module_public'].split(".")[0] PACKAGE = list(core_conf['projects_all'].values()).pop()['module_public'].split(".")[0]
else: else:
PACKAGE = [w for w in core_conf['weeks_all'].values() if 'module_public' in w][0]['module_public'].split(".")[0] PACKAGE = [w for w in core_conf['weeks_all'].values() if 'module_public' in w][0]['module_public'].split(".")[0]
# =======
# try:
# if len(core_conf['projects_all']) > 0:
# PACKAGE = list(core_conf['projects_all'].values()).pop()['module_public'].split(".")[0]
# else:
# PACKAGE = list(core_conf['weeks_all'].values()).pop()['module_public'].split(".")[0]
# except Exception as e:
# PACKAGE = core_conf['package']
# >>>>>>> 5f0cf05ea2c51749713d10331847fbe062613bab
if censor_files: if censor_files:
assert not run_files, "You cannot run files while you are censoring them -- your scripts will crash. Call with run_files=False." assert not run_files, "You cannot run files while you are censoring them -- your scripts will crash. Call with run_files=False."
...@@ -94,7 +85,7 @@ def setup_student_files(run_files=True, ...@@ -94,7 +85,7 @@ def setup_student_files(run_files=True,
exclude += [f'tests_week{w if w >= 10 else f"0{w}"}.py' for w in range(0,14) if w not in week] exclude += [f'tests_week{w if w >= 10 else f"0{w}"}.py' for w in range(0,14) if w not in week]
exclude = exclude + ["**/" + ex for ex in exclude] exclude = exclude + ["**/" + ex for ex in exclude]
if not include_exam_examples: if not include_exam_examples:
exclude += ['exam_tabular_examples'] exclude += ['*/exam_tabular_examples/*']
inclusion = [] # 'ex09old/cache'] inclusion = [] # 'ex09old/cache']
hws = [] hws = []
for m in midterms: for m in midterms:
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
sym 0 → 100755
ym 0 → 100755
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment