Revert "allows passing an input path as argument"
This reverts commit af712a22ab447be76d1b2a4bd32794a604017008.
This commit is contained in:
parent
3ebe8a46b7
commit
e11c14d382
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user