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