From 04484ad56d264b6a595db6854ccbc6d7e2f3cefb Mon Sep 17 00:00:00 2001 From: Jacob Daniel Bennett Date: Sun, 20 Sep 2020 16:51:53 -0400 Subject: [PATCH] remove Directory Information from initial message --- api/ECNQueue.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 458536d..6535ad8 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -222,6 +222,12 @@ def __parseSections(self) -> list: " Subject: " ] + # Reference to Remove Directory Items from initial message + directoryLinesToRemove = [] + + # Line Counter + lineCounter = 0 + # Parses the initial message for directory information for lineContents in initialMessageContent: @@ -229,8 +235,20 @@ def __parseSections(self) -> list: # Checks if the line starts with any of the directory parameters if lineContents.startswith(itemsindirectory): + + # Appends line number to be removed from initial message + directoryLinesToRemove.append(lineCounter) + # Adds the contents of the line to the directory info directoryInfo.append(lineContents) + + break + + # Increment the line counter by after each line + lineCounter = lineCounter + 1 + # Parses the initial message to remove directory information + for lineNumber in sorted(directoryLinesToRemove, reverse=True): + initialMessageContent.pop(lineNumber) # Appends Directory Information into the sections array sections.append( @@ -750,3 +768,4 @@ def getQueues() -> list: queues.append(Queue(file)) return queues +