Revert "allows passing an input path as argument"

This reverts commit af712a22ab447be76d1b2a4bd32794a604017008.
This commit is contained in:
Audrey Aaliyah Jensen 2023-10-30 10:43:42 -05:00
parent 3ebe8a46b7
commit e11c14d382
No known key found for this signature in database
GPG Key ID: 7FFD7540EBC253EE

View File

@ -13,15 +13,20 @@ import os
import email
from email import policy
from multiprocessing import Pool
<<<<<<< HEAD
import sys
import re
EXTENSION = "eml"
OUTREGEX = ".*\\\\"
INREGEX = ".*\\\\$"
=======
EXTENSION = "eml"
>>>>>>> parent of af712a2 (allows passing an input path as argument)
def extract(filename):
print(filename)
"""
Try to extract the attachments from all files in cwd
"""
@ -58,6 +63,7 @@ def extract(filename):
if __name__ == "__main__":
<<<<<<< HEAD
path = ""
if len(sys.argv) > 1:
path = sys.argv[1]
@ -68,9 +74,11 @@ if __name__ == "__main__":
path += "\\\\"
else:
path = "./"
=======
>>>>>>> parent of af712a2 (allows passing an input path as argument)
# let's do this in parallel, using cpu count as number of threads
pool = Pool(None)
res = pool.map(extract, glob.iglob("%s*.%s" % (path, EXTENSION)))
res = pool.map(extract, glob.iglob("*.%s" % EXTENSION))
# need these if we use _async
pool.close()
pool.join()