From 10595be8655e391032a9edfb754d0b30ac590a5e Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Fri, 15 Feb 2019 13:26:22 +0100 Subject: [PATCH] Show full account name in timeline --- tests/test_console.py | 12 ++++++------ toot/output.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_console.py b/tests/test_console.py index 3aef54d..1923613 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -123,7 +123,7 @@ def test_timeline(mock_get, monkeypatch, capsys): 'id': '111111111111111111', 'account': { 'display_name': 'Frank Zappa 🎸', - 'username': 'fz' + 'acct': 'fz' }, 'created_at': '2017-04-12T15:53:18.174Z', 'content': "

The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.

", @@ -159,12 +159,12 @@ def test_timeline_with_re(mock_get, monkeypatch, capsys): 'created_at': '2017-04-12T15:53:18.174Z', 'account': { 'display_name': 'Frank Zappa', - 'username': 'fz' + 'acct': 'fz' }, 'reblog': { 'account': { 'display_name': 'Johnny Cash', - 'username': 'jc' + 'acct': 'jc' }, 'content': "

The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.

", 'media_attachments': [], @@ -201,7 +201,7 @@ def test_thread(mock_get, monkeypatch, capsys): 'id': '111111111111111111', 'account': { 'display_name': 'Frank Zappa', - 'username': 'fz' + 'acct': 'fz' }, 'created_at': '2017-04-12T15:53:18.174Z', 'content': "my response in the middle", @@ -214,7 +214,7 @@ def test_thread(mock_get, monkeypatch, capsys): 'id': '111111111111111110', 'account': { 'display_name': 'Frank Zappa', - 'username': 'fz' + 'acct': 'fz' }, 'created_at': '2017-04-12T15:53:18.174Z', 'content': "original content", @@ -225,7 +225,7 @@ def test_thread(mock_get, monkeypatch, capsys): 'id': '111111111111111112', 'account': { 'display_name': 'Frank Zappa', - 'username': 'fz' + 'acct': 'fz' }, 'created_at': '2017-04-12T15:53:18.174Z', 'content': "response message", diff --git a/toot/output.py b/toot/output.py index 171b36d..87a8a63 100644 --- a/toot/output.py +++ b/toot/output.py @@ -136,7 +136,7 @@ def print_status(status, width): time = datetime.strptime(time, "%Y-%m-%dT%H:%M:%S.%fZ") time = time.strftime('%Y-%m-%d %H:%M%z') - username = "@" + status['account']['username'] + username = "@" + status['account']['acct'] spacing = width - wcswidth(username) - wcswidth(time) display_name = status['account']['display_name'] @@ -166,7 +166,7 @@ def print_status(status, width): print_out("\n{}{}{}".format( "ID {} ".format(status['id']), "↲ In reply to {} ".format(in_reply_to) if in_reply_to else "", - "↻ Reblogged @{} ".format(reblog['account']['username']) if reblog else "", + "↻ Reblogged @{} ".format(reblog['account']['acct']) if reblog else "", ))