Skip to content

Commit

Permalink
Fix line length lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Buried-In-Code committed Oct 25, 2024
1 parent ef47a11 commit 9788587
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
18 changes: 12 additions & 6 deletions esak/schemas/comic.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ class Comic(BaseResource):
"""The Comic object contains information for a comic.
Attributes:
digital_id: The ID of the digital comic representation of this comic. Will be 0 if the comic is not available digitally.
digital_id: The ID of the digital comic representation of this comic.
Will be 0 if the comic is not available digitally.
title: The canonical title of the comic.
issue_number: The number of the issue in the series (will generally be 0 for collection formats).
variant_description: If the issue is a variant (e.g. an alternate cover, second printing, or director's cut), a text description of the variant.
issue_number: The number of the issue in the series.
Will generally be 0 for collection formats.
variant_description: If the issue is a variant (e.g. an alternate cover,
second printing, or director's cut), a text description of the variant.
description: The preferred description of the comic.
isbn: The ISBN for the comic (generally only populated for collection formats).
upc: The UPC barcode number for the comic (generally only populated for periodical formats).
Expand All @@ -93,9 +96,12 @@ class Comic(BaseResource):
page_count: The number of story pages in the comic.
text_objects: A set of descriptive text blurbs for the comic.
series: A summary representation of the series to which this comic belongs.
variants: A list of variant issues for this comic (includes the "original" issue if the current issue is a variant).
collections: A list of collections which include this comic (will generally be empty if the comic's format is a collection).
collected_issues: A list of issues collected in this comic (will generally be empty for periodical formats such as "comic" or "magazine").
variants: A list of variant issues for this comic (includes the "original"
issue if the current issue is a variant).
collections: A list of collections which include this comic (will generally
be empty if the comic's format is a collection).
collected_issues: A list of issues collected in this comic (will generally
be empty for periodical formats such as "comic" or "magazine").
dates: A list of key dates for this comic.
prices: A list of prices for this comic.
images: A list of promotional images associated with this comic.
Expand Down
3 changes: 2 additions & 1 deletion esak/schemas/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Creator(BaseResource):
middle_name: The middle name of the creator.
last_name: The last name of the creator.
suffix: The suffix or honorific for the creator.
full_name: The full name of the creator (a space-separated concatenation of the above four fields).
full_name: The full name of the creator (a space-separated concatenation of the
above four fields).
comics: A resource list containing the comics which feature work by this creator.
series: A resource list containing the series which feature work by this creator.
stories: A resource list containing the stories which feature work by this creator.
Expand Down
3 changes: 2 additions & 1 deletion esak/schemas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class Series(BaseResource):
title: The canonical title of the series.
description: A description of the series.
start_year: The first year of publication for the series.
end_year: The last year of publication for the series (conventionally, 2099 for ongoing series).
end_year: The last year of publication for the series
(conventionally, 2099 for ongoing series).
rating: The age-appropriateness rating for the series.
type:
creators: A resource list of creators whose work appears in comics in this series.
Expand Down
3 changes: 2 additions & 1 deletion esak/schemas/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class Story(BaseResource):
series: A resource list containing series in which this story appears.
comics: A resource list containing comics in which this story takes place.
events: A resource list of the events in which this story appears.
original_issue: A summary representation of the issue in which this story was originally published.
original_issue: A summary representation of the issue in which this story
was originally published.
"""

title: str
Expand Down
8 changes: 5 additions & 3 deletions esak/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def _create_cached_params(params: dict[str, Any]) -> str:
params: A dictionary of parameters that will be passed to the API request.
Returns:
A URL-encoded string of the parameters sorted by key, prefixed by a '?' if any parameters exist. Returns an empty string if no parameters are provided.
A URL-encoded string of the parameters sorted by key, prefixed by a '?' if
any parameters exist. Returns an empty string if no parameters are provided.
"""
cache_params = ""
if params:
Expand All @@ -73,7 +74,8 @@ def _create_auth_hash(self, now_string: str) -> str:
now_string: A timestamp string in the format "%Y-%m-%d%H:%M:%S".
Returns:
An MD5 hash string generated by combining the timestamp, private key and public key required by the Marvel API.
An MD5 hash string generated by combining the timestamp, private key
and public key required by the Marvel API.
"""
auth_hash = md5() # noqa: S324
auth_hash.update(now_string.encode("utf-8"))
Expand Down Expand Up @@ -144,7 +146,7 @@ def _call(self, endpoint: list[str | int], params: Optional[dict[str, Any]] = No
The 'results' field from the API response.
Raises:
ApiError: If the API response contains an error message or if the status code is not 200.
ApiError: If the API response contains an error message or if the status code is not 200
"""
if params is None:
params = {}
Expand Down
5 changes: 4 additions & 1 deletion tests/comics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def test_known_comic(talker: Session) -> None:
assert af15.issue_number == "15"
assert (
af15.description
== "The First Appearance of the Amazing Spider-Man! When young Peter Parker gains remarkable abilities from a radioactive spider, he must step up and try to become a hero — while also dealing with the fantastic pressures of an everyday teenager! For with great power, there must also come great responsibility!"
== "The First Appearance of the Amazing Spider-Man! When young Peter Parker gains \
remarkable abilities from a radioactive spider, he must step up and try to become a \
hero — while also dealing with the fantastic pressures of an everyday teenager! For \
with great power, there must also come great responsibility!"
)
assert af15.format == "Comic"
assert af15.id == 16926
Expand Down

0 comments on commit 9788587

Please sign in to comment.