Skip to content

Commit

Permalink
Updated documentation for error parsing helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Daniel Bennett committed Oct 22, 2020
1 parent 6dc675a commit 8e720f5
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8e720f5

Please sign in to comment.