drop extracted files into the email file's dir

This commit is contained in:
Audrey Aaliyah Jensen 2023-09-08 11:08:13 -05:00
parent 8fb6c693ef
commit c0981619bb

View File

@ -27,7 +27,8 @@ def extract(filename):
""" """
# ensure that an output dir exists # ensure that an output dir exists
filepath = re.findall(OUTREGEX, filename) filepath = re.findall(OUTREGEX, filename)
od = (filepath[0] or "") + "/output" od = (filepath[0] or "") + "/"
os.path.exists(od) or os.makedirs(od) os.path.exists(od) or os.makedirs(od)
output_count = 0 output_count = 0
try: try:
@ -60,6 +61,7 @@ if __name__ == "__main__":
path = "" path = ""
if len(sys.argv) > 1: if len(sys.argv) > 1:
path = sys.argv[1] path = sys.argv[1]
print("Path: " + path)
#Make sure there's a trailing slash #Make sure there's a trailing slash
pathRE = re.search(INREGEX, path) pathRE = re.search(INREGEX, path)
if pathRE is None: if pathRE is None: