Skip to content
Snippets Groups Projects
Commit bc30e7fa authored by Dennis Baurichter's avatar Dennis Baurichter
Browse files

commit: Change name error to warning and fix output

If a file on the command line does not conform to the naming scheme,
warn about it, but don't abort. Usefull e.g. in cases of 'commit *' or
similar.
Changes behaviour from d5765fbe
See #75

"Hazard: multiple exams with same name" gets it's output about which
exams are affected.
Fixes #76

Change warning color to yellow.
parent b8865309
No related branches found
No related tags found
No related merge requests found
......@@ -285,9 +285,8 @@ def allExams():
n=klausurarchiv.namingscheme.New(fn)
except:
if not fDirectory:
print("\x1b[31;1mError\x1b[30;0m: %s does not conform to naming "
"scheme!"%(fn))
exit(1)
print("\x1b[31;1mWarning\x1b[30;0m: %s does not conform to naming "
"scheme. Skipping!"%(fn))
continue
if os.path.isdir(fn):
......@@ -482,6 +481,8 @@ for base, ns, items in sorted(all_exams,key=lambda i:i[1].lectures):
output+=(" \x1b[32;1mnon-existent\x1b[30;0m %s\n"%item)
if hasSimilar:
sys.stdout.write(output)
output=""
sys.stdout.write(
"\x1b[33;1mHazard\x1b[30;0m: "
"There are multiple exams with the same name.\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment