tm = time.strptime(date, "%Y-%m-%dT%H:%M:%S")
self.datestamp = calendar.timegm(tm)
+ self.account = data['account']
+
def text(self):
yield text.SeparatorLine(self.datestamp)
+ yield text.FromLine('@' + self.account['acct'],
+ self.account['display_name'])
class MainUI(Client):
def run(self):
# FIXME: colours
suffix = "[" + date + "]--"
return "-" * (width - len(suffix)) + suffix
+
+class FromLine:
+ def __init__(self, account, nameline):
+ self.account = account
+ self.nameline = nameline
+
+ def render(self, width):
+ # FIXME: truncate
+
+ return f"From: {self.nameline} ({self.account})"