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