AIEmailAutomationUtility 0.0.31__py3-none-any.whl → 0.0.32__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AIEmailAutomationUtility/Email_Read.py +1 -1
- AIEmailAutomationUtility/Process_Category.py +11 -10
- {AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/METADATA +3 -3
- {AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/RECORD +7 -7
- {AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/LICENCE.txt +0 -0
- {AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/WHEEL +0 -0
- {AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/top_level.txt +0 -0
@@ -579,7 +579,7 @@ class Email_Read:
|
|
579
579
|
|
580
580
|
def log_email_login(self, user_id, email, model_name, login_status):
|
581
581
|
base_dir="EMail_log"
|
582
|
-
timestamp = datetime.now().strftime("%Y-%m-%
|
582
|
+
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
583
583
|
log_dir = os.path.join(base_dir, user_id)
|
584
584
|
os.makedirs(log_dir, exist_ok=True)
|
585
585
|
log_file_path = os.path.join(log_dir, f"{user_id}.csv")
|
@@ -106,12 +106,13 @@ class Process_Category:
|
|
106
106
|
logger.log(f"document_type 108::: {document_type}")
|
107
107
|
|
108
108
|
if responseMethod == "Upload_Document":
|
109
|
-
# Get today's date folder path
|
110
|
-
today_date = datetime.today().strftime('%Y-%m-%d')
|
111
|
-
order_folder = os.path.join(document_type, today_date)
|
112
109
|
|
113
110
|
email_upload_document = Email_DocumentUploader()
|
114
111
|
if len(fileName) != 0 and document_type != '':
|
112
|
+
# Get today's date folder path
|
113
|
+
today_date = datetime.today().strftime('%Y-%m-%d')
|
114
|
+
order_folder = os.path.join(document_type, today_date)
|
115
|
+
|
115
116
|
file_path = os.path.join(order_folder, fileName) # Correct file path
|
116
117
|
|
117
118
|
with open(file_path, "rb") as file:
|
@@ -366,7 +367,7 @@ class Process_Category:
|
|
366
367
|
mail.expunge()
|
367
368
|
logger.log(f"Mail removed from inbox and added to '{LABEL}' label.")
|
368
369
|
|
369
|
-
current_timestamp = datetime.now().strftime("%Y-%m-%
|
370
|
+
current_timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
370
371
|
filename = f'{uid}{current_timestamp}'
|
371
372
|
logger.log(f"The file name for csv and eml is ::: {filename}")
|
372
373
|
self.store_email_details_to_csv(
|
@@ -426,7 +427,7 @@ class Process_Category:
|
|
426
427
|
filename = part.get_filename()
|
427
428
|
mime_type = part.get_content_type().lower()
|
428
429
|
|
429
|
-
if "pdf" in mime_type:
|
430
|
+
if "pdf" in mime_type or filename.lower().endswith(".pdf"):
|
430
431
|
document_type = "Orders"
|
431
432
|
elif "msword" in mime_type or "wordprocessingml" in mime_type or filename.lower().endswith(".docx"):
|
432
433
|
document_type = "Order Excel"
|
@@ -438,12 +439,12 @@ class Process_Category:
|
|
438
439
|
document_type = "Order Email"
|
439
440
|
elif "rtf" in mime_type or filename.lower().endswith(".rtf"):
|
440
441
|
document_type = "Order Excel"
|
441
|
-
|
442
|
-
today_date = datetime.today().strftime('%Y-%m-%d') # Format: YYYY-MM-DD
|
443
|
-
date_folder = os.path.join(document_type, today_date) # Path: ORDERS/YYYY-MM-DD
|
444
|
-
os.makedirs(date_folder, exist_ok=True)
|
445
442
|
|
446
443
|
if filename:
|
444
|
+
today_date = datetime.today().strftime('%Y-%m-%d') # Format: YYYY-MM-DD
|
445
|
+
date_folder = os.path.join(document_type, today_date) # Path: ORDERS/YYYY-MM-DD
|
446
|
+
os.makedirs(date_folder, exist_ok=True)
|
447
|
+
|
447
448
|
filepath = os.path.join(date_folder, filename) # Save inside date-wise folder
|
448
449
|
|
449
450
|
with open(filepath, 'wb') as f:
|
@@ -479,7 +480,7 @@ class Process_Category:
|
|
479
480
|
fileName = fileName + ".txt"
|
480
481
|
filePath = os.path.join(order_folder, fileName)
|
481
482
|
|
482
|
-
with open(filePath, "w") as file:
|
483
|
+
with open(filePath, "w", encoding="utf-8") as file:
|
483
484
|
file.write(text)
|
484
485
|
logger.log(f"New TXT file created from email body and stored in '{filePath}'")
|
485
486
|
else:
|
{AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/METADATA
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: AIEmailAutomationUtility
|
3
|
-
Version: 0.0.
|
4
|
-
Summary:
|
3
|
+
Version: 0.0.32
|
4
|
+
Summary: Make changes in code, should run for windows and ubuntu
|
5
5
|
Author: Proteus Technology PVT. LTD.
|
6
6
|
Author-email: <apps@baseinformation.com>
|
7
7
|
Keywords: python,first package
|
@@ -13,4 +13,4 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
13
13
|
Classifier: Operating System :: Microsoft :: Windows
|
14
14
|
License-File: LICENCE.txt
|
15
15
|
|
16
|
-
|
16
|
+
Make changes in code, should run for windows and ubuntu
|
{AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/RECORD
RENAMED
@@ -2,14 +2,14 @@ AIEmailAutomationUtility/EmailReplyAssistant.py,sha256=R_wJna3-ITsVxQEccryhM93T_
|
|
2
2
|
AIEmailAutomationUtility/Email_Classification.py,sha256=Ar0g4Ff8HOT7xICktd3nP_C_vCyeY-xCpUjVCVRWAyc,9417
|
3
3
|
AIEmailAutomationUtility/Email_DocumentUploader.py,sha256=YJu4tuTHr0K-5vuds9gZfj-Hwsgm4MuAOP39Lmu_t98,3219
|
4
4
|
AIEmailAutomationUtility/Email_Draft.py,sha256=DcyBeDaE8CReKHnHxLiz-o2tDxuUgwy91c4k0qhQbVw,7749
|
5
|
-
AIEmailAutomationUtility/Email_Read.py,sha256=
|
5
|
+
AIEmailAutomationUtility/Email_Read.py,sha256=zE2dK4h0XfKWuSuMJs3E2U-yMPHzRtBfNSdP74h_pDI,30743
|
6
6
|
AIEmailAutomationUtility/Email_Upload_Document.py,sha256=3bdkxfDlwoeRp-46KPw2Gs1dqBhEIoA1yE5GCudpdV8,1320
|
7
|
-
AIEmailAutomationUtility/Process_Category.py,sha256=
|
7
|
+
AIEmailAutomationUtility/Process_Category.py,sha256=xXiXYf_dmscKO6scFOMRCWLgKhsV8RsCVK1AXPnE1DI,44695
|
8
8
|
AIEmailAutomationUtility/Save_Draft.py,sha256=yzLgFN14I_lXE6qL0I3tKNduvcnWdbsY9i2mKdTtio4,5348
|
9
9
|
AIEmailAutomationUtility/Save_Transaction.py,sha256=Gg1w6hhzHmEFjsuzYvkq-3-EsWReetjLHsYSv5YIGgM,3816
|
10
10
|
AIEmailAutomationUtility/__init__.py,sha256=Jad3IdPRsVMeLqEEh-FbCrc1lE2tzJO2DTG5Hgmxh5g,391
|
11
|
-
AIEmailAutomationUtility-0.0.
|
12
|
-
AIEmailAutomationUtility-0.0.
|
13
|
-
AIEmailAutomationUtility-0.0.
|
14
|
-
AIEmailAutomationUtility-0.0.
|
15
|
-
AIEmailAutomationUtility-0.0.
|
11
|
+
AIEmailAutomationUtility-0.0.32.dist-info/LICENCE.txt,sha256=2qX9IkEUBx0VJp1Vh9O2dsRwE-IpYId0lXDyn7OVsJ8,1073
|
12
|
+
AIEmailAutomationUtility-0.0.32.dist-info/METADATA,sha256=m0b6nXm2W1DSYwxU9Mbt8oPd7ujQ90BDc8I9ohdK3ck,611
|
13
|
+
AIEmailAutomationUtility-0.0.32.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
14
|
+
AIEmailAutomationUtility-0.0.32.dist-info/top_level.txt,sha256=3jTWrTUblVkaP7mpwY2UBSnrlfot5Ykpfsehyke-Uzw,25
|
15
|
+
AIEmailAutomationUtility-0.0.32.dist-info/RECORD,,
|
{AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/LICENCE.txt
RENAMED
File without changes
|
{AIEmailAutomationUtility-0.0.31.dist-info → AIEmailAutomationUtility-0.0.32.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|