Skip to content

Commit

Permalink
Added priority, department, building and date received attributes to …
Browse files Browse the repository at this point in the history
…Item class
  • Loading branch information
Justin Campbell committed Jul 27, 2020
1 parent 55a9f8d commit 9ed552b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def __init__(self, queue: str, number: int) -> None:
self.assignedTo = self.__getAssignedTo()
self.subject = self.__getMostRecentHeaderByType("Subject")
self.status = self.__getMostRecentHeaderByType("Status")
self.priority = self.__getMostRecentHeaderByType("Priority")
self.department = self.__getMostRecentHeaderByType("Department")
self.building = self.__getMostRecentHeaderByType("Building")
self.dateReceived = self.__getMostRecentHeaderByType("Date")

self.jsonData = {
"lastUpdated": self.lastUpdated,
Expand All @@ -60,17 +64,21 @@ def __init__(self, queue: str, number: int) -> None:
"userAlias": self.userAlias,
"assignedTo": self.assignedTo,
"subject": self.subject,
"status": self.status
"status": self.status,
"priority": self.priority,
"deparment": self.department,
"building": self.building,
"dateReceived": self.dateReceived
}

def __getLastUpdated(self) -> float:
def __getLastUpdated(self) -> str:
"""Returns last modified time of item reported by the filesystem in mm-dd-yy hh:mm am/pm format.
Example:
07-23-20 10:34 AM
Returns:
float: last modified time of item reported by the filesystem in mm-dd-yy hh:mm am/pm format.
str: last modified time of item reported by the filesystem in mm-dd-yy hh:mm am/pm format.
"""
unixTime = os.path.getmtime(self.__path)
formattedTime = time.strftime('%m-%d-%y %I:%M %p', time.localtime(unixTime))
Expand Down

0 comments on commit 9ed552b

Please sign in to comment.