diff --git a/Sandbox Scripts/extract.py b/Sandbox Scripts/extract.py index 023714e..5e11fdf 100644 --- a/Sandbox Scripts/extract.py +++ b/Sandbox Scripts/extract.py @@ -13,11 +13,13 @@ import os import email from email import policy from multiprocessing import Pool +import sys EXTENSION = "eml" - +OUTPATH = "" def extract(filename): + print(filename) """ Try to extract the attachments from all files in cwd """ @@ -52,9 +54,10 @@ def extract(filename): if __name__ == "__main__": + path = sys.argv[1] or "" # let's do this in parallel, using cpu count as number of threads pool = Pool(None) - res = pool.map(extract, glob.iglob("*.%s" % EXTENSION)) + res = pool.map(extract, glob.iglob("%s*.%s" % (path, EXTENSION))) # need these if we use _async pool.close() pool.join()