Skip to content
Snippets Groups Projects
Commit 854eba6c authored by tuhe's avatar tuhe
Browse files

Updates

parent e708411e
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup(
name="coursebox",
version="0.1.20.6",
version="0.1.20.9",
author="Tue Herlau",
author_email="tuhe@dtu.dk",
description="A course management system currently used at DTU",
......
Metadata-Version: 2.1
Metadata-Version: 2.2
Name: coursebox
Version: 0.1.20.4
Version: 0.1.20.9
Summary: A course management system currently used at DTU
Home-page: https://lab.compute.dtu.dk/tuhe/coursebox
Author: Tue Herlau
......@@ -23,6 +23,17 @@ Requires-Dist: langdetect
Requires-Dist: beamer-slider
Requires-Dist: tinydb
Requires-Dist: python-gitlab
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary
# Coursebox DTU
DTU course management software.
......
......@@ -98,7 +98,7 @@ def first_day_of_class(info):
mo_first = datetime(year=year(), month=1 if semester() == 'spring' else 8, day=1, hour=info.get('lecture_start_hour', 13), minute=0)
# scroll to monday
while mo_first.weekday() != 0: #strftime('%A') is not 'Monday':
mo_first -= timedelta(days=1)
mo_first += timedelta(days=1) # Don't subtract here.
# add 4 weeks to get into 13 week period
for _ in range(4):
mo_first += timedelta(days=7)
......@@ -169,6 +169,7 @@ def lectures(info, pensum=None):
l['day'] = d.day
l['date'] = d
l['preceded_by_holiday'] = i == holiday
l['followed_by_holiday'] = i+1 == holiday
l = {**l, **date2format(d)}
if not continuing_education():
......@@ -469,6 +470,14 @@ def class_information(verbose=False,
d['sections'] = sections
current_lecture = -2
for k, l in enumerate(d['lectures']):
current_lecture = k - 1
if l['date'] >= datetime.now():
break
d['current_lecture_number'] = current_lecture
return d
def _update_with_core_conf(d):
......
......@@ -93,6 +93,10 @@ def build_sphinx_documentation(cut_files=False, open_browser=True, build_and_cop
# print(">>> k class is: ")
# 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()
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]
......@@ -232,12 +236,13 @@ def build_sphinx_documentation(cut_files=False, open_browser=True, build_and_cop
my_env['PYTHONPATH'] = (paths['02450students'] + '_complete').replace("\\", "/")
print("Running", cmd)
process = run(cmd, print_output=True, log_output=True, check=False, env=my_env)
print("Done running sphinx build command.")
"""r
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
"""
if os.name == 'nt':
print("This is windows. Building again:")
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(process.stderr.getvalue())
......@@ -270,7 +275,7 @@ Below is a summary of the problems we found: """)
for im in ["gb.png", "dk.png"]:
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:
verbose = False
setup_student_files(run_files=False, cut_files=False, censor_files=True, setup_lectures=cut_files,
......
......@@ -15,7 +15,8 @@ def setup_student_files(run_files=True,
week=None, extra_dirs=None,
include_solutions=None,
projects=None,
setup_lectures=False, strict=True,
setup_lectures=False,
strict=True,
fix_shared_files=True,
include_exam_examples=False, # Include the directory with exam-related examples.
verbose=True,
......@@ -33,21 +34,11 @@ def setup_student_files(run_files=True,
from coursebox.core.info import class_information
# info = class_information()
from coursebox.core.info import core_conf
# <<<<<<< HEAD
# if 'package' not in core_conf:
if len(core_conf['projects_all']) > 0:
PACKAGE = list(core_conf['projects_all'].values()).pop()['module_public'].split(".")[0]
else:
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:
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,
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]
if not include_exam_examples:
exclude += ['exam_tabular_examples']
exclude += ['*/exam_tabular_examples/*']
inclusion = [] # 'ex09old/cache']
hws = []
for m in midterms:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment