diff --git a/api/ECNQueue.py b/api/ECNQueue.py index a716fa8..8230d9f 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -36,6 +36,7 @@ class Item: # TODO: Add Item class documentation def __init__(self, queue: str, number: int) -> None: + self.queue = queue try: self.number = int(number) @@ -781,19 +782,25 @@ def __getFormattedMessageContent(self, messageContent: list) -> list: return messageContent def __errorParsing(self, line: str, lineNum: int, expectedSyntax: str) -> dict: - """Returns a dictionary with error parse information + """Returns a dictionary with error parse information when a line is malformed + + Example: + "*** Status updated by: ewhile at: 5/7/2020 10:59:11 *** sharing between\n" + + Args: + line (str): line of that threw error + lineNum (int): line number in the item that threw error + expectedSyntax (str): a message stating the syntax the line should follow Returns: - { - dictionary: "type": "parse_error", - datetime: time_of_execution, - content: [ - 'expected value item_row_num:item_column_num', - 'current line in item' - ] - } + dict: a dictionary with these keys, + "type": "parse_error", + "datetime": time the error was encountered, + "file_path": path of the item with erroneos line, + "expected": expectedSyntax, + "got": line, + "line_num": lineNum """ - errorDictionary = {} # Type