check if gradebook/submissions dir exists and has files to inspect
This commit is contained in:
@@ -3,9 +3,13 @@ from utils.inspector import generate_hashes_submissions, generate_duplicate_hash
|
||||
|
||||
|
||||
def main():
|
||||
submissions_dir_name = ' '.join(sys.argv[1:]) if len(sys.argv) > 1 else exit(f'\nNo submissions dir name given. Provide the name as an argument.\n\nUsage: python {sys.argv[0]} [submissions dir name]\nExample: python {sys.argv[0]} AssignmentX\n')
|
||||
submissions_dir_name = ' '.join(sys.argv[1:]) if len(sys.argv) > 1 else exit(f'\nNo submissions directory name given. Provide the name as an argument.\n\nUsage: python {sys.argv[0]} [submissions dir name]\nExample: python {sys.argv[0]} AssignmentX\n')
|
||||
|
||||
submissions_dir_path = os.path.join('BB_submissions', submissions_dir_name)
|
||||
if not os.path.exists(submissions_dir_path):
|
||||
exit('[Info] Directory does not exist - nothing to inspect')
|
||||
if not os.listdir(submissions_dir_path): # if no files in dir
|
||||
exit(f'[Info] No files found in this submissions directory - nothing to inspect')
|
||||
# generate CSV file with hashes for all files in submissions (except for any 'excluded') & return path to CSV file for finding duplicate hashes
|
||||
hashes_csv_file_path = generate_hashes_submissions(submissions_dir_path)
|
||||
# generate CSV file with files having duplicate hashes
|
||||
|
||||
Reference in New Issue
Block a user