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 +