Last active
August 29, 2015 14:16
-
-
Save distributedlock/581aeff1d1b37a8433c7 to your computer and use it in GitHub Desktop.
WLU: Marking script for unzipping and deleting temp files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
__author__ = "RanadeepPolavarapu" | |
__email__ = "[email protected]" | |
__version__ = "1.0.0" | |
import os | |
import shlex | |
print("[INFO]: Iterating file list...") | |
for file in os.listdir("."): | |
if file.endswith(".zip"): | |
student_login = file.split('-')[-1].rstrip('.zip') | |
os.system( | |
"unzip {ZIP_FILE} -d {STUDENT_DIR} 1> /dev/null".format( | |
ZIP_FILE=shlex.quote(file), | |
STUDENT_DIR=student_login)) | |
print("[INFO]: Unzipped all files!") | |
print("[INFO]: Deleting all temp C lang files...") | |
os.system("""find . -type f -name "\#*" -delete 1> /dev/null""") | |
os.system("""find . -type f -name "*~" -delete 1> /dev/null""") | |
os.system("""find . -type f -name "*.o" -delete 1> /dev/null""") | |
print("[INFO]: Cleaned out all backup and temp files!") | |
os.system("""rm -rf *.zip 1> /dev/null""") | |
print("[INFO]: Ready for marking!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment