From 1ce874b02bc9c990fbf9c2e5eb29c02884390de8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 31 May 2020 17:00:17 +0200 Subject: [PATCH 1/5] Fix indent of setup() --- setup.py | 88 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/setup.py b/setup.py index f54bd8d5..6e07420f 100755 --- a/setup.py +++ b/setup.py @@ -88,52 +88,54 @@ else: with open('README.rst', encoding='utf-8') as readme_fd: LONG_DESCRIPTION = readme_fd.read() -setup(name="poezio", - version="0.14" + version, - description="A console XMPP client", - long_description=LONG_DESCRIPTION, - ext_modules=[module_poopt], - url='https://poez.io/', - license='zlib', - download_url='https://dev.louiz.org/projects/poezio/files', +setup( + name="poezio", + version="0.14" + version, + description="A console XMPP client", + long_description=LONG_DESCRIPTION, + ext_modules=[module_poopt], + url='https://poez.io/', + license='zlib', + download_url='https://dev.louiz.org/projects/poezio/files', - author='Florent Le Coz', - author_email='louiz@louiz.org', + author='Florent Le Coz', + author_email='louiz@louiz.org', - maintainer='Mathieu Pasquet', - maintainer_email='mathieui@mathieui.net', + maintainer='Mathieu Pasquet', + maintainer_email='mathieui@mathieui.net', - classifiers=['Development Status :: 5 - Production/Stable', - 'Topic :: Communications :: Chat', - 'Topic :: Internet :: XMPP', - 'Environment :: Console :: Curses', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: zlib/libpng License', - 'Natural Language :: English', - 'Operating System :: Unix', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3 :: Only'], - keywords=['jabber', 'xmpp', 'client', 'chat', 'im', 'console'], - packages=['poezio', 'poezio.core', 'poezio.tabs', 'poezio.windows', - 'poezio.ui', 'poezio_plugins', 'poezio_themes'], - package_dir={'poezio': 'poezio', - 'poezio_plugins': 'plugins', - 'poezio_themes': 'data/themes'}, - package_data={'poezio': ['default_config.cfg']}, - scripts=['scripts/poezio_logs'], - entry_points={'console_scripts': ['poezio = poezio.__main__:run']}, - data_files=([('share/man/man1/', ['data/poezio.1', - 'data/poezio_logs.1']), - ('share/poezio/', ['README.rst', 'COPYING', 'CHANGELOG']), - ('share/applications/', ['data/io.poez.Poezio.desktop']), - ('share/metainfo/', ['data/io.poez.Poezio.appdata.xml'])] - + find_doc('share/doc/poezio/source', 'source') - + find_doc('share/doc/poezio/html', 'build/html')), - install_requires=['slixmpp>=1.5.2', 'aiodns', 'pyasn1_modules', 'pyasn1'], - extras_require={'OTR plugin': 'python-potr>=1.0', - 'Screen autoaway plugin': 'pyinotify==0.9.4', - 'Avoiding cython': 'cffi'}) + classifiers=['Development Status :: 5 - Production/Stable', + 'Topic :: Communications :: Chat', + 'Topic :: Internet :: XMPP', + 'Environment :: Console :: Curses', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: zlib/libpng License', + 'Natural Language :: English', + 'Operating System :: Unix', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3 :: Only'], + keywords=['jabber', 'xmpp', 'client', 'chat', 'im', 'console'], + packages=['poezio', 'poezio.core', 'poezio.tabs', 'poezio.windows', + 'poezio.ui', 'poezio_plugins', 'poezio_themes'], + package_dir={'poezio': 'poezio', + 'poezio_plugins': 'plugins', + 'poezio_themes': 'data/themes'}, + package_data={'poezio': ['default_config.cfg']}, + scripts=['scripts/poezio_logs'], + entry_points={'console_scripts': ['poezio = poezio.__main__:run']}, + data_files=([('share/man/man1/', ['data/poezio.1', + 'data/poezio_logs.1']), + ('share/poezio/', ['README.rst', 'COPYING', 'CHANGELOG']), + ('share/applications/', ['data/io.poez.Poezio.desktop']), + ('share/metainfo/', ['data/io.poez.Poezio.appdata.xml'])] + + find_doc('share/doc/poezio/source', 'source') + + find_doc('share/doc/poezio/html', 'build/html')), + install_requires=['slixmpp>=1.5.2', 'aiodns', 'pyasn1_modules', 'pyasn1'], + extras_require={'OTR plugin': 'python-potr>=1.0', + 'Screen autoaway plugin': 'pyinotify==0.9.4', + 'Avoiding cython': 'cffi'} +) # Remove the link afterwards if (os.path.exists(os.path.join(current_dir, 'poezio', 'default_config.cfg')) and From 601f38f5aeb881d38775569cc4203bfff6f31694 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 31 May 2020 17:22:37 +0200 Subject: [PATCH 2/5] setup: add a build_man command and integrate sphinx manpages into install --- setup.py | 61 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 6e07420f..1e7dd8fc 100755 --- a/setup.py +++ b/setup.py @@ -1,15 +1,21 @@ #!/usr/bin/env python3 +import os +import subprocess +import sys +from tempfile import TemporaryFile try: from setuptools import setup, Extension except ImportError: print('\nSetuptools was not found. Install setuptools for python 3.\n') - import sys sys.exit(1) -import os -import subprocess -from tempfile import TemporaryFile +cmdclass = {} +try: + from sphinx.setup_command import BuildDoc + cmdclass = {'build_man': BuildDoc} +except ImportError: + print('\nSphinx not found, the build_man command will be unavailable.\n') current_dir = os.path.dirname(__file__) @@ -57,8 +63,30 @@ def check_include(library_name, header): print('%s headers not found.' % library_name) return False +def sphinx_man(): + expected_sphinx_files = [ + 'build/sphinx/man/poezio.cfg.7', + 'build/sphinx/man/poezio.keys.7', + 'build/sphinx/man/poezio.commands.7' + ] + found = [] + for item in expected_sphinx_files: + if os.path.exists(item): + found.append(item) + if found: + return [('share/man/man7/', found)] + return [] + + +sphinx_files_found = sphinx_man() +if not sphinx_files_found: + print( + '\nSphinx-built manpages not found. Only the ' + 'short handwritten manpages will be installed\n' + ) + + if not check_include('python3', 'Python.h'): - import sys sys.exit(2) module_poopt = Extension('poezio.poopt', @@ -124,17 +152,26 @@ setup( package_data={'poezio': ['default_config.cfg']}, scripts=['scripts/poezio_logs'], entry_points={'console_scripts': ['poezio = poezio.__main__:run']}, - data_files=([('share/man/man1/', ['data/poezio.1', - 'data/poezio_logs.1']), - ('share/poezio/', ['README.rst', 'COPYING', 'CHANGELOG']), - ('share/applications/', ['data/io.poez.Poezio.desktop']), - ('share/metainfo/', ['data/io.poez.Poezio.appdata.xml'])] + data_files=([ + ('share/man/man1/', ['data/poezio.1', 'data/poezio_logs.1']), + ('share/poezio/', ['README.rst', 'COPYING', 'CHANGELOG']), + ('share/applications/', ['data/io.poez.Poezio.desktop']), + ('share/metainfo/', ['data/io.poez.Poezio.appdata.xml']) + ] + find_doc('share/doc/poezio/source', 'source') - + find_doc('share/doc/poezio/html', 'build/html')), + + find_doc('share/doc/poezio/html', 'build/html') + + sphinx_files_found + ), install_requires=['slixmpp>=1.5.2', 'aiodns', 'pyasn1_modules', 'pyasn1'], extras_require={'OTR plugin': 'python-potr>=1.0', 'Screen autoaway plugin': 'pyinotify==0.9.4', - 'Avoiding cython': 'cffi'} + 'Avoiding cython': 'cffi'}, + cmdclass=cmdclass, + command_options={ + 'build_man' : { + 'builder': ('setup.py', 'man'), + } + }, ) # Remove the link afterwards From 9d70054ffb4c959bf58ead9c524a4b34f92af419 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 31 May 2020 17:25:44 +0200 Subject: [PATCH 3/5] Update poezio.1 manpage --- data/poezio.1 | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/data/poezio.1 b/data/poezio.1 index d54e991c..b2fd66ff 100644 --- a/data/poezio.1 +++ b/data/poezio.1 @@ -1,45 +1,48 @@ .\" Copyright 2010 Le Coz Florent .\" This man page is distributed under the GPLv3 license. .\" See COPYING file -.TH "Poezio" "1" "September 26, 2011" "Poezio dev team" "" +.TH "Poezio" "1" "May 31, 2020" "Poezio dev team" "" .SH "NAME" -Poezio \- a ncurses jabber client written in python3 +Poezio \- a ncurses jabber client written in python .SH "SYNOPSIS" .B poezio [\-f \fICONFIG_FILE\fR] [\-d \fIDEBUG_FILE\fR] [\-h] .SH "DESCRIPTION" .B Poezio -is a console jabber (XMPP) client written in Python and using ncurses to draw its interface. It aims at being similar to the most famous IRC clients, like weechat or irssi. The keyboard shortcuts are inspired from emacs. For more information on XMPP see http://xmpp.org and on Poezio see https://poez.io +is a console jabber (XMPP) client written in Python and using ncurses to draw its interface. It aims at being similar to the most famous IRC clients, like weechat or irssi. Some keyboard shortcuts are inspired from emacs. For more information on XMPP see http://xmpp.org and on Poezio see https://poez.io .PP .SH "OPTIONS" .TP \fB\-f\fR, \fB\-\-file \fICONFIG_FILE\fR -Run poezio using \fICONFIG_FILE\fR as the config file instead of ~/.config/poezio/poezio.cfg +Run poezio using \fICONFIG_FILE\fR as the config file instead of ~/.config/poezio/poezio.cfg. .TP \fB\-d\fR, \fB\-\-debug \fIDEBUG_FILE\fR -Log debug from both poezio and SleekXMPP in \fIDEBUG_FILE\fR. Debug contains incoming and outgoing stanzas in addition to various message helping poezio's debugging. +Log debug from both poezio and slixmpp in \fIDEBUG_FILE\fR. Debug contains incoming and outgoing stanzas in addition to various message helping poezio's debugging. .TP -\fB\-h\fR -Display an help message +\fB\-c\fR, \fB\-\-check\-config\fR +Display the list of modified/unmodified config options, with their changes from the default. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display the poezio help message. -.SH "TABS" -A \fItab\fR, in Poezio, is the base structure of the interface. A tab may contains one or more \fIwindows\fR, and can be of different types: +.SH "BASICS" + +The following sections will give you a short overview on how to use poezio. Poezio has many more options, commands and key bindings, please refer to \fIpoezio.cfg(7)\fR, \fIpoezio.commands(7)\fR, \fIpoezio.keys(7)\fR or the full documentation which should have been provided alongside the source code, or check it online at https://doc.poez.io/. + +A \fItab\fR, in Poezio, is the base structure of the interface. A tab may contains one or more \fIwindows\fR, the main types are: .RS .TP 6 .I Roster \fRtab -It contains a list of your contacts on the left, as well as an info window on the right. +It contains a browsable list of your contacts on the left, as well as an info window on the right. .TP -.I MUC \fRtab -MUC stands for "Multi-User Chat". +.I Chatroom \fRtab +This tab displays the contents of a multi-user chat. .TP .I Conversation \fRtab It is used for one-to-one communication, usually when using a real Jabber account. -.TP -.I Private \fRtab -It is used to privately communicate with someone in a MUC. .SH "KEY BINDINGS" While most of the keyboard shortcuts are common to all types of tabs, some of them are tab-specific. -.SS Text edition +.SS Text edition These shortcuts work in any kind of tab; most of them are identical to emacs' ones. .RS .TP 8 @@ -146,9 +149,6 @@ The opposite of \fI/accept\fR. .SS MUC-specific commands .RS .TP 5 -.B /recolor -Change the color of the nicknames in the conversation. Useful when a few people are talking and their random color happen to be the same: using this command will let you differentiate them more easily. -.TP .B /kick Kick the specified user from the room. .TP @@ -165,7 +165,7 @@ View or change the topic of the room. Talk privately with the specified participant. .TP .B /part -Leave the current room. +Leave the current room. .SH "BUGS" Sure. @@ -174,7 +174,7 @@ Sure. If you're using a terminal multiplexer such as \fIscreen\fR or \fItmux\fR, it may be setting $TERM to "screen", which breaks 256-color support. Consider setting your $TERM to something like "screen-256color". .SH "FEEDBACK" -You are encouraged to report bugs or feature requests on https://dev.louiz.org/projects/poezio. +You are encouraged to report bugs or feature requests on https://lab.louiz.org/poezio/poezio. You can also find us on the Jabber chatroom poezio@muc.poez.io .SH "AUTHORS" From 2d72a80d224003e4680b6cba25fe80b78d3753c4 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 31 May 2020 17:35:14 +0200 Subject: [PATCH 4/5] Update CHANGELOG --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 695972e9..1ea483e0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,8 @@ https://dev.louiz.org/projects/poezio/roadmap - Fix marquee and dice plugin to use newer Last Message Correction format. - Bookmarks tab properly displays bookmarks method (local/remote) and allows to switch between them again. +- Updated manpages and added manpages built from the doc in the setup process. + Packagers need to run setup.py build_man to have them built. # Forgotten additions From 887ab27920636c0248639c5f437396a4610a4a51 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 31 May 2020 17:39:05 +0200 Subject: [PATCH 5/5] manpage: update room address to be an URI --- data/poezio.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/poezio.1 b/data/poezio.1 index b2fd66ff..4e9fbf12 100644 --- a/data/poezio.1 +++ b/data/poezio.1 @@ -175,7 +175,7 @@ If you're using a terminal multiplexer such as \fIscreen\fR or \fItmux\fR, it ma .SH "FEEDBACK" You are encouraged to report bugs or feature requests on https://lab.louiz.org/poezio/poezio. -You can also find us on the Jabber chatroom poezio@muc.poez.io +You can also find us on the Jabber chatroom xmpp:poezio@muc.poez.io?join .SH "AUTHORS" Written by Florent Le Coz