diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 8eb109c..77c688e 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -51,6 +51,7 @@ currentFileDirectory = os.path.dirname(currentFilePath) currentFileDirectoryParent = os.path.dirname(currentFileDirectory) queueDirectory = os.path.join(currentFileDirectoryParent, "q-snapshot") +queueDirectory = "/home/pier/e/queue/Mail" # Queues to not load in getQueues() queuesToIgnore = ["archives", "drafts", "inbox", "coral"] @@ -1200,7 +1201,18 @@ def __getUserAlias(self) -> str: Returns: str: User's Career Account alias if present or empty string """ - emailUser, emailDomain = self.userEmail.split("@") + + # Returns an error parse if the useremail isn't valid + try: + emailUser, emailDomain = self.userEmail.split("@") + + except: + # Parses through the self.headers list to find the "From" header and its line number + for lineNum, header in enumerate(self.headers): + if header["type"] == "From": + headerString = header["type"] + ": " + header["content"] + return self.__errorParsing(headerString, lineNum + 1, "Expected valid email Address") + return emailUser if emailDomain.endswith("purdue.edu") else "" def __getFormattedDate(self, date: str) -> str: @@ -1355,4 +1367,8 @@ def loadQueues() -> list: for queue in getValidQueues(): queues.append(Queue(queue)) - return queues \ No newline at end of file + return queues + +if __name__ == "__main__": + item = Item("me", 105) + print() \ No newline at end of file