From d2ad5bb3162551c718115e11409ff8b764916c7f Mon Sep 17 00:00:00 2001 From: Jacob Daniel Bennett Date: Fri, 16 Oct 2020 09:36:06 -0400 Subject: [PATCH] Subject key added to the initial message --- api/ECNQueue.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 8740614..e5afa24 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -182,7 +182,6 @@ def __parseSections(self) -> list: contentEnd = len(self.__rawItem) - 1 #directoryInfo = {"type": "directoryInformation"} - initialMessageContent = [] initialMessageSection = True # Delimiter info @@ -419,10 +418,11 @@ def __initialMessageParsing(self, content: list) -> dict: Returns: dictionary: "type": "initial_message", "datetime": utcdate, - "from_name": fromName, - "from_email": userEmail, + "from_name": from_name, + "from_email": user_email, "to": [{email, name}], "cc": [{email, name}], + "subject": initial_message_subject "content": ["message_content"] """ initialMessageDictionary = {} @@ -467,7 +467,7 @@ def __initialMessageParsing(self, content: list) -> dict: "email": ccRecipients[1]} ) - #rawMessageContent = self.__rawItem[startLine : endLine] + initialMessageDictionary["subject"] = self.__getMostRecentHeaderByType("Subject") # Removes unecessary newlines from the begining and the end of the initial message initialMessageDictionary["content"] = self.__getFormattedMessageContent(content) @@ -938,4 +938,10 @@ def getQueues() -> list: if isDirectory and isValid: queues.append(Queue(file)) - return queues \ No newline at end of file + return queues +if __name__ == "__main__": + item = Item("ce", 100) + print() +# for queue in getQueues(): +# for item in queue.items: +# print(f"${item.queue} ${item.number}") \ No newline at end of file