Skip to content

Commit

Permalink
remove Directory Information from initial message
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Daniel Bennett committed Sep 20, 2020
1 parent 22b2e65 commit 04484ad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,33 @@ 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:

for itemsindirectory in directoryInfoPattern:

# 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(
Expand Down Expand Up @@ -750,3 +768,4 @@ def getQueues() -> list:
queues.append(Queue(file))

return queues

0 comments on commit 04484ad

Please sign in to comment.