Wykres commitów

12 Commity (images)

Autor SHA1 Wiadomość Data
Daniel Schwarz 5343bccb15 Refactored all image code into tui/images.py
All image code is now a soft dependency. If the term-image
and/or pillow libraries are not loaded, the tui will work
fine without displaying images.

Note that tests/test_utils.py still has a dependency on pillow
due to its use of Image for tsting the LRUCache.
2024-01-19 18:04:02 -05:00
Daniel Schwarz 481cf89e3a cleanup to make flake8 happy 2023-12-18 22:30:34 -05:00
Daniel Schwarz c3e715b46c Merge branch 'master' into images 2023-12-18 21:47:57 -05:00
Daniel Schwarz 7a7f4d4679 Merge remote-tracking branch 'upstream/master' into images 2023-11-30 23:42:23 -05:00
Ivan Habunek d8c7084678
Migrate auth commands 2023-11-30 20:12:04 +01:00
Daniel Schwarz 732b9feed5 Added test for toot.utils.urlencode_url(...) 2023-11-16 20:24:53 -05:00
Daniel Schwarz 8d1a562d1d
Images are now cached in memory (10MB) with a LRU eviction policy 2023-07-07 14:05:18 +02:00
Ivan Habunek 0e13914fce
Add duration parsing 2022-12-01 10:20:50 +01:00
Ivan Habunek 8a3ff94e47
Consolidate wcwidth-related utils in one module 2019-02-14 15:45:27 +01:00
Ivan Habunek 769ff9e406
Add wcstring utils 2019-02-14 15:23:46 +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