Skip to content

Commit

Permalink
Correct mis-spelled parse_eaders to parse_headers and added header on…
Browse files Browse the repository at this point in the history
…ly loading with args docs
  • Loading branch information
campb303 committed Jun 21, 2021
1 parent c4e8532 commit b72ae74
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/webqueue2api/parser/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
class Item:
"""A single issue.
Args:
queue (str): The name of the Item's queue.
number (int): The number of the Item.
headersOnly (bool, optional): Whether or not to parse headers only. Defaults to False.
Example:
# Create an Item (ce100)
`item = Item("ce", 100)`
Expand Down Expand Up @@ -45,7 +50,7 @@ class Item:
ItemDoesNotExistError: If an item does not exist on the filesystem.
"""

def __init__(self, queue: str, number: int) -> None:
def __init__(self, queue: str, number: int, headers_only: bool = False) -> None:
self.queue = queue

try:
Expand All @@ -59,8 +64,8 @@ def __init__(self, queue: str, number: int) -> None:

self.last_updated = self.__get_time_last_updated()
self.__raw_tem = self.__get_raw_item()
self.headers = self.__parse_eaders()
self.content = self.__parseSections()
self.headers = self.__parse_headers()
if not headers_only: self.content = self.__parseSections()
self.is_locked = self.__check_is_locked()
self.user_email = self.__parse_from_data(data="user_email")
self.user_name = self.__parse_from_data(data="user_name")
Expand Down Expand Up @@ -155,7 +160,7 @@ def __get_header_boundary(self) -> int:
if line == "\n":
return line_number

def __parse_eaders(self) -> list:
def __parse_headers(self) -> list:
"""Returns a list containing dictionaries of header type and data.
Removes queue prefixes and whitespace.
Expand Down

0 comments on commit b72ae74

Please sign in to comment.