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

commit: Abort if a file on command line is invalid

Exit if a given file does not conform to the naming scheme.

Fixes #75
parent b7ff0357
No related branches found
No related tags found
No related merge requests found
......@@ -241,8 +241,9 @@ def user_barrier(prompt):
%prompt)
input()
# processes the input directories for fCreateSourceDirectories or fDirectory
# and yields all files found
# Yield all files to be processed according to the file names given on the
# command line and fDirectory, fRecurse. This could contain non-.pdf/.source
# files.
def allFiles():
global files
if fDirectory:
......@@ -283,6 +284,10 @@ def allExams():
try:
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)
continue
if os.path.isdir(fn):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment