Show full account name in timeline

This commit is contained in:
Ivan Habunek 2019-02-15 13:26:22 +01:00
parent 5a867f2380
commit 10595be865
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
2 changed files with 8 additions and 8 deletions

View File

@ -123,7 +123,7 @@ def test_timeline(mock_get, monkeypatch, capsys):
'id': '111111111111111111', 'id': '111111111111111111',
'account': { 'account': {
'display_name': 'Frank Zappa 🎸', 'display_name': 'Frank Zappa 🎸',
'username': 'fz' 'acct': 'fz'
}, },
'created_at': '2017-04-12T15:53:18.174Z', 'created_at': '2017-04-12T15:53:18.174Z',
'content': "<p>The computer can&apos;t tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.</p>", 'content': "<p>The computer can&apos;t tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.</p>",
@ -159,12 +159,12 @@ def test_timeline_with_re(mock_get, monkeypatch, capsys):
'created_at': '2017-04-12T15:53:18.174Z', 'created_at': '2017-04-12T15:53:18.174Z',
'account': { 'account': {
'display_name': 'Frank Zappa', 'display_name': 'Frank Zappa',
'username': 'fz' 'acct': 'fz'
}, },
'reblog': { 'reblog': {
'account': { 'account': {
'display_name': 'Johnny Cash', 'display_name': 'Johnny Cash',
'username': 'jc' 'acct': 'jc'
}, },
'content': "<p>The computer can&apos;t tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.</p>", 'content': "<p>The computer can&apos;t tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.</p>",
'media_attachments': [], 'media_attachments': [],
@ -201,7 +201,7 @@ def test_thread(mock_get, monkeypatch, capsys):
'id': '111111111111111111', 'id': '111111111111111111',
'account': { 'account': {
'display_name': 'Frank Zappa', 'display_name': 'Frank Zappa',
'username': 'fz' 'acct': 'fz'
}, },
'created_at': '2017-04-12T15:53:18.174Z', 'created_at': '2017-04-12T15:53:18.174Z',
'content': "my response in the middle", 'content': "my response in the middle",
@ -214,7 +214,7 @@ def test_thread(mock_get, monkeypatch, capsys):
'id': '111111111111111110', 'id': '111111111111111110',
'account': { 'account': {
'display_name': 'Frank Zappa', 'display_name': 'Frank Zappa',
'username': 'fz' 'acct': 'fz'
}, },
'created_at': '2017-04-12T15:53:18.174Z', 'created_at': '2017-04-12T15:53:18.174Z',
'content': "original content", 'content': "original content",
@ -225,7 +225,7 @@ def test_thread(mock_get, monkeypatch, capsys):
'id': '111111111111111112', 'id': '111111111111111112',
'account': { 'account': {
'display_name': 'Frank Zappa', 'display_name': 'Frank Zappa',
'username': 'fz' 'acct': 'fz'
}, },
'created_at': '2017-04-12T15:53:18.174Z', 'created_at': '2017-04-12T15:53:18.174Z',
'content': "response message", 'content': "response message",

View File

@ -136,7 +136,7 @@ def print_status(status, width):
time = datetime.strptime(time, "%Y-%m-%dT%H:%M:%S.%fZ") time = datetime.strptime(time, "%Y-%m-%dT%H:%M:%S.%fZ")
time = time.strftime('%Y-%m-%d %H:%M%z') time = time.strftime('%Y-%m-%d %H:%M%z')
username = "@" + status['account']['username'] username = "@" + status['account']['acct']
spacing = width - wcswidth(username) - wcswidth(time) spacing = width - wcswidth(username) - wcswidth(time)
display_name = status['account']['display_name'] display_name = status['account']['display_name']
@ -166,7 +166,7 @@ def print_status(status, width):
print_out("\n{}{}{}".format( print_out("\n{}{}{}".format(
"ID <yellow>{}</yellow> ".format(status['id']), "ID <yellow>{}</yellow> ".format(status['id']),
"↲ In reply to <yellow>{}</yellow> ".format(in_reply_to) if in_reply_to else "", "↲ In reply to <yellow>{}</yellow> ".format(in_reply_to) if in_reply_to else "",
"↻ Reblogged <blue>@{}</blue> ".format(reblog['account']['username']) if reblog else "", "↻ Reblogged <blue>@{}</blue> ".format(reblog['account']['acct']) if reblog else "",
)) ))