Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -55,12 +55,10 @@ class Message(object):
if "url" not in attachment:
try:
attachment["url"] = next(
s['url'] for s in attachment["sources"] if 'url' in s
s["url"] for s in attachment["sources"] if "url" in s
)
except (StopIteration, KeyError):
log.warning(
f"An attachment has no URL: {attachment}"
)
log.warning(f"An attachment has no URL: {attachment}")
@property
def id(self):
@ -126,7 +124,6 @@ class Message(object):
return self.extra.get("attachments", [])
class Messages(object):
def __init__(self, msgs_data):
self.messages = [Message(m) for m in msgs_data]
@ -166,7 +163,7 @@ class Identity(object):
@property
def avatar_basename(self):
try:
return basename(self.data['avatar']['path'])
return basename(self.data["avatar"]["path"])
except (TypeError, KeyError):
return None