Skip to content

Commit

Permalink
Pep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamschmalhofer committed Mar 14, 2024
1 parent 1072da1 commit c8f330b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions grocy_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def get_purchase(self, args: CliArgs) -> list[Purchase]:
for part in email.walk()
if part.get_content_type() == 'text/html'
)[0].get_payload(decode=True)
soup = BeautifulSoup(html, 'html5lib')
soup = BeautifulSoup(cast(bytes, html), 'html5lib')
purchase = list(column.get_text()
for row
in soup.select(' '.join(7*["tbody"] + ["tr"]))
Expand Down Expand Up @@ -1264,11 +1264,14 @@ def given_context_or_no_context_regex(context: str) -> re.Pattern[str]:
return re.compile(rf'{literal_context}|^[^@]*([^ ]@[^@]*)*$')


def chore_due_is_before(time: datetime, chore_id: int, grocy: GrocyApi) -> bool:
def chore_due_is_before(time: datetime, chore_id: int, grocy: GrocyApi
) -> bool:
try:
return grocy.get_chore_due(chore_id) < time.strftime('%Y-%m-%d %H:%M:%S')
return (grocy.get_chore_due(chore_id)
< time.strftime('%Y-%m-%d %H:%M:%S'))
except TypeError:
print(f'Warning: chore {chore_id} has no due date. Skipping', file=sys.stderr)
print(f'Warning: chore {chore_id} has no due date. Skipping',
file=sys.stderr)
return True


Expand Down

0 comments on commit c8f330b

Please sign in to comment.