ruff: enable B warnings (mainly suppressed exceptions and unused variables)
This commit is contained in:
parent
d0df8e8f2d
commit
72cc8ff3ac
30 changed files with 83 additions and 67 deletions
|
@ -6,12 +6,12 @@ from datetime import datetime
|
|||
|
||||
def parse_org_datetime(s: str) -> datetime:
|
||||
s = s.strip('[]')
|
||||
for fmt, cl in [
|
||||
("%Y-%m-%d %a %H:%M", datetime),
|
||||
("%Y-%m-%d %H:%M" , datetime),
|
||||
# todo not sure about these... fallback on 00:00?
|
||||
# ("%Y-%m-%d %a" , date),
|
||||
# ("%Y-%m-%d" , date),
|
||||
for fmt, _cls in [
|
||||
("%Y-%m-%d %a %H:%M", datetime),
|
||||
("%Y-%m-%d %H:%M" , datetime),
|
||||
# todo not sure about these... fallback on 00:00?
|
||||
# ("%Y-%m-%d %a" , date),
|
||||
# ("%Y-%m-%d" , date),
|
||||
]:
|
||||
try:
|
||||
return datetime.strptime(s, fmt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue