mirror of
https://github.com/ihabunek/toot.git
synced 2024-11-03 04:17:21 -05:00
0bf4b2a21a
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.)
51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
#!/usr/bin/env python
|
|
|
|
from setuptools import setup
|
|
|
|
long_description = """
|
|
toot is a commandline tool for interacting with Mastodon social networks.
|
|
Allows posting text and media to the timeline, searching, following, muting
|
|
and blocking accounts and other actions.
|
|
Contains an experimental curses application for reading the timeline.
|
|
"""
|
|
|
|
setup(
|
|
name='toot',
|
|
version='0.20.0',
|
|
description='Mastodon CLI client',
|
|
long_description=long_description.strip(),
|
|
author='Ivan Habunek',
|
|
author_email='ivan@habunek.com',
|
|
url='https://github.com/ihabunek/toot/',
|
|
project_urls={
|
|
'Documentation': 'https://toot.readthedocs.io/en/latest/',
|
|
'Issue tracker': 'https://github.com/ihabunek/toot/issues/',
|
|
},
|
|
keywords='mastodon toot',
|
|
license='GPLv3',
|
|
classifiers=[
|
|
'Development Status :: 4 - Beta',
|
|
'Environment :: Console :: Curses',
|
|
'Environment :: Console',
|
|
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
|
'Programming Language :: Python :: 3',
|
|
'Programming Language :: Python :: 3.3',
|
|
'Programming Language :: Python :: 3.4',
|
|
'Programming Language :: Python :: 3.5',
|
|
'Programming Language :: Python :: 3.6',
|
|
],
|
|
data_files=[('', ['Makefile'])],
|
|
packages=['toot', 'toot.ui'],
|
|
python_requires=">=3.3",
|
|
install_requires=[
|
|
"requests>=2.13,<3.0",
|
|
"beautifulsoup4>=4.5.0,<5.0",
|
|
"wcwidth>=0.1.7,<2.0",
|
|
],
|
|
entry_points={
|
|
'console_scripts': [
|
|
'toot=toot.console:main',
|
|
],
|
|
}
|
|
)
|