Reformatted code base using black.

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

View file

@ -79,10 +79,12 @@ class Simple(object):
def messages(self, data):
# TODO: handle lang, and non chat message (normal, headline)
for mess_data in data:
(uid, timestamp, from_jid, to_jid, message, subject, mess_type,
extra) = mess_data
time_str = date_utils.date_fmt(timestamp, "auto_day",
tz_info=date_utils.TZ_LOCAL)
(uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra) = (
mess_data
)
time_str = date_utils.date_fmt(
timestamp, "auto_day", tz_info=date_utils.TZ_LOCAL
)
from_jid = jid.JID(from_jid)
if mess_type == C.MESS_TYPE_GROUPCHAT:
nick = from_jid.resource
@ -95,10 +97,19 @@ class Simple(object):
nick_color = A.BOLD + A.FG_YELLOW
message = list(message.values())[0] if message else ""
self.host.disp(A.color(
A.FG_CYAN, '['+time_str+'] ',
nick_color, nick, A.RESET, A.BOLD, '> ',
A.RESET, message))
self.host.disp(
A.color(
A.FG_CYAN,
"[" + time_str + "] ",
nick_color,
nick,
A.RESET,
A.BOLD,
"> ",
A.RESET,
message,
)
)
class Json(object):