Reformatted code base using black.
This commit is contained in:
parent
56319cbad3
commit
53fdaa9d09
1 changed files with 12604 additions and 8966 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue