1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-23 15:37:47 +01:00
Commit Graph

15 Commits

Author SHA1 Message Date
Ivan Habunek
d21cad892c
Implement composing tweets using an editor
fixes #90
2019-08-22 17:37:24 +02:00
Ivan Habunek
8a3ff94e47
Consolidate wcwidth-related utils in one module 2019-02-14 15:45:27 +01:00
Ivan Habunek
8805a50194
Cleanup utils dealing with wcwidth strings 2019-02-14 14:21:53 +01:00
Denis Laxalde
0bf4b2a21a
Fix left column padding in timeline with wide characters
When the left column contains wide characters (which occupy more than
one cell when printed to screen), padding to 30-characters with
"{:30}".format() does not work well. This happens for instance when the
display name contains unicode characters such as emojis.

We fix this by introducing a pad() function in utils module which uses
the wcwidth library (https://pypi.org/project/wcwidth/) to compute the
length of the text for the column. trunc() function is also adjusted to
optionally compute the length of the text to be truncated since, when
called from pad(), we now pre-compute this value.

We update test for timeline rendering so that the display name now
includes an emoji. (Without the fix, the test would not pass as left
column would be misaligned.)
2019-02-14 14:21:53 +01:00
Ivan Habunek
0dfb04e9e3
Ignore bs4 warnings
These are triggered by false positives and get printed to screen when
running `toot curses`.
2019-02-13 13:38:37 +01:00
Ivan Habunek
32b1c67d49
Make boolen params a bit less verbose 2019-01-24 11:23:12 +01:00
Ivan Habunek
fc57d2695a
Merge pull request #83 from dlax/apos
Replace ' by "'" before parsing HTML
2019-01-02 11:39:21 +01:00
Ivan Habunek
14a580bc19
Make toot post prompt for input if no text is given
fixes #82
2019-01-02 10:50:56 +01:00
Denis Laxalde
0f6bd920c3 Replace ' by "'" before parsing HTML
Beautiful will does not parse HTML entities like `'` as we expect
and the previous logic of replacing this *after* HTML parsing occurred
did not produced expected results.

To illustrate this, we change data in "test_timeline" to include a
literal `'` as it sometimes occur in data returned by Mastodon API.
New HTML content is:

    <p>The computer can&apos;t tell you the emotional story [...] </p>

Beautiful will parse this as as:

    <p>The computer can&amp;apost tell you the emotional story [...] </p>

which is not what we expect.

We fix this by replacing `&apos;` *before* HTML parsing by Beautiful.
Since test data in "test_timeline" got updated we also add an extra
assertion checking that part of the content with a literal "'" is
(still) properly rendered.
2019-01-01 23:14:54 +01:00
Ivan Habunek
2ecc6a28c6
Normalize unicode 2018-01-21 16:39:40 +01:00
Ivan Habunek
0ef5a9e41e
Dynamically size the status list window
This makes toot more usable on narrow screens. Still requires 60
columns minimum.

fixes #26
2018-01-14 15:46:28 +01:00
Ivan Habunek
92d4dc745a
Use http methods instead of requests directly 2017-12-30 16:30:35 +01:00
Ivan Habunek
dfdad045f0
Add instance command 2017-12-29 14:26:40 +01:00
Ivan Habunek
1b86cdd404
Drop support for Python 2
It's hard to maintain both versions, having unicode issues in py2, etc.
2017-12-29 11:31:21 +01:00
Ivan Habunek
47b6a830a1
Rework status content wrapping 2017-04-26 11:01:28 +02:00