Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dinfk-lecturers
mossutils
Commits
a8c8da88
Commit
a8c8da88
authored
May 09, 2020
by
scmalte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aggr.py: added more helpful exception when cluster file template missing
parent
d4ce0139
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
mossutils/aggr.py
mossutils/aggr.py
+8
-2
No files found.
mossutils/aggr.py
View file @
a8c8da88
...
...
@@ -9,12 +9,14 @@ DEFAULT_CLUSTER_FILES_DIR="_clusters"
DEFAULT_CLUSTERS_MATCHES_CSV_FILE
=
"clusters-matches.csv"
DEFAULT_CLUSTER_STUDENTS_CSV_FILE_PATTERN
=
"cluster-students-{}.csv"
DEFAULT_CX_COURSE_STUDENTS_CSV_FILE
=
"cx_students.csv"
DEFAULT_JINJA_CLUSTER_TEMPLATE_FILE
=
"./_static/clusters.html.jinja"
def
main
(
cluster_files_dir
=
DEFAULT_CLUSTER_FILES_DIR
,
clusters_matches_csv_file
=
DEFAULT_CLUSTERS_MATCHES_CSV_FILE
,
cluster_students_csv_file_pattern
=
DEFAULT_CLUSTER_STUDENTS_CSV_FILE_PATTERN
,
cx_course_students_csv_file
=
DEFAULT_CX_COURSE_STUDENTS_CSV_FILE
):
cx_course_students_csv_file
=
DEFAULT_CX_COURSE_STUDENTS_CSV_FILE
,
jinja_cluster_template_file
=
DEFAULT_JINJA_CLUSTER_TEMPLATE_FILE
):
logutils
.
configure_level_and_format
()
...
...
@@ -82,7 +84,11 @@ def main(
jinja2_file_loader
=
jinja2
.
FileSystemLoader
(
"."
)
jinja2_env
=
jinja2
.
Environment
(
loader
=
jinja2_file_loader
)
template
=
jinja2_env
.
get_template
(
"./_static/clusters.html.jinja"
)
try
:
template
=
jinja2_env
.
get_template
(
jinja_cluster_template_file
)
except
jinja2
.
exceptions
.
TemplateNotFound
as
exception
:
raise
RuntimeError
(
"Couldn't load Jinja2 template {}. Should have been created by mu-init."
.
format
(
jinja_cluster_template_file
))
# output = template.render(colors=colors)
# print(output)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment