From 332a5c2553db41de777473a1e1be9cd1522c9496 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 31 Mar 2016 18:54:41 +0100 Subject: [PATCH] Move the src directory to poezio, for better cython compatibility. --- Makefile | 2 +- doc/source/conf.py | 2 +- doc/source/keys.rst | 2 +- launch.sh | 2 +- plugins/link.py | 2 +- {src => poezio}/args.py | 0 {src => poezio}/bookmarks.py | 0 {src => poezio}/common.py | 0 {src => poezio}/config.py | 0 {src => poezio}/connection.py | 0 {src => poezio}/contact.py | 0 {src => poezio}/core/__init__.py | 0 {src => poezio}/core/commands.py | 0 {src => poezio}/core/completions.py | 0 {src => poezio}/core/core.py | 0 {src => poezio}/core/handlers.py | 0 {src => poezio}/core/structs.py | 0 {src => poezio}/daemon.py | 0 {src => poezio}/decorators.py | 0 {src => poezio}/events.py | 0 {src => poezio}/fifo.py | 0 {src => poezio}/fixes.py | 0 {src => poezio}/keyboard.py | 0 {src => poezio}/logger.py | 0 {src => poezio}/multiuserchat.py | 0 {src => poezio}/pep.py | 0 {src => poezio}/plugin.py | 0 {src => poezio}/plugin_manager.py | 0 {src => poezio}/poezio.py | 0 {src => poezio}/poezio_shlex.py | 0 {src => poezio}/pooptmodule.c | 0 {src => poezio}/roster.py | 0 {src => poezio}/roster_sorting.py | 0 {src => poezio}/singleton.py | 0 {src => poezio}/size_manager.py | 0 {src => poezio}/tabs/__init__.py | 0 {src => poezio}/tabs/adhoc_commands_list.py | 0 {src => poezio}/tabs/basetabs.py | 0 {src => poezio}/tabs/bookmarkstab.py | 0 {src => poezio}/tabs/conversationtab.py | 0 {src => poezio}/tabs/data_forms.py | 0 {src => poezio}/tabs/listtab.py | 0 {src => poezio}/tabs/muclisttab.py | 0 {src => poezio}/tabs/muctab.py | 0 {src => poezio}/tabs/privatetab.py | 0 {src => poezio}/tabs/rostertab.py | 0 {src => poezio}/tabs/xmltab.py | 0 {src => poezio}/text_buffer.py | 0 {src => poezio}/theming.py | 0 {src => poezio}/timed_events.py | 0 {src => poezio}/user.py | 0 {src => poezio}/windows/__init__.py | 0 {src => poezio}/windows/base_wins.py | 2 +- {src => poezio}/windows/bookmark_forms.py | 0 {src => poezio}/windows/data_forms.py | 0 {src => poezio}/windows/funcs.py | 0 {src => poezio}/windows/info_bar.py | 0 {src => poezio}/windows/info_wins.py | 0 {src => poezio}/windows/input_placeholders.py | 0 {src => poezio}/windows/inputs.py | 0 {src => poezio}/windows/list.py | 0 {src => poezio}/windows/misc.py | 0 {src => poezio}/windows/muc.py | 0 {src => poezio}/windows/roster_win.py | 0 {src => poezio}/windows/text_win.py | 0 {src => poezio}/xhtml.py | 0 setup.py | 12 ++++++------ src/__init__.py | 1 - test/test_common.py | 2 +- test/test_completion.py | 2 +- test/test_config.py | 2 +- test/test_poopt.py | 2 +- test/test_theming.py | 2 +- test/test_windows.py | 2 +- test/test_xhtml.py | 2 +- update.sh | 10 ---------- 76 files changed, 19 insertions(+), 30 deletions(-) rename {src => poezio}/args.py (100%) rename {src => poezio}/bookmarks.py (100%) rename {src => poezio}/common.py (100%) rename {src => poezio}/config.py (100%) rename {src => poezio}/connection.py (100%) rename {src => poezio}/contact.py (100%) rename {src => poezio}/core/__init__.py (100%) rename {src => poezio}/core/commands.py (100%) rename {src => poezio}/core/completions.py (100%) rename {src => poezio}/core/core.py (100%) rename {src => poezio}/core/handlers.py (100%) rename {src => poezio}/core/structs.py (100%) rename {src => poezio}/daemon.py (100%) rename {src => poezio}/decorators.py (100%) rename {src => poezio}/events.py (100%) rename {src => poezio}/fifo.py (100%) rename {src => poezio}/fixes.py (100%) rename {src => poezio}/keyboard.py (100%) rename {src => poezio}/logger.py (100%) rename {src => poezio}/multiuserchat.py (100%) rename {src => poezio}/pep.py (100%) rename {src => poezio}/plugin.py (100%) rename {src => poezio}/plugin_manager.py (100%) rename {src => poezio}/poezio.py (100%) rename {src => poezio}/poezio_shlex.py (100%) rename {src => poezio}/pooptmodule.c (100%) rename {src => poezio}/roster.py (100%) rename {src => poezio}/roster_sorting.py (100%) rename {src => poezio}/singleton.py (100%) rename {src => poezio}/size_manager.py (100%) rename {src => poezio}/tabs/__init__.py (100%) rename {src => poezio}/tabs/adhoc_commands_list.py (100%) rename {src => poezio}/tabs/basetabs.py (100%) rename {src => poezio}/tabs/bookmarkstab.py (100%) rename {src => poezio}/tabs/conversationtab.py (100%) rename {src => poezio}/tabs/data_forms.py (100%) rename {src => poezio}/tabs/listtab.py (100%) rename {src => poezio}/tabs/muclisttab.py (100%) rename {src => poezio}/tabs/muctab.py (100%) rename {src => poezio}/tabs/privatetab.py (100%) rename {src => poezio}/tabs/rostertab.py (100%) rename {src => poezio}/tabs/xmltab.py (100%) rename {src => poezio}/text_buffer.py (100%) rename {src => poezio}/theming.py (100%) rename {src => poezio}/timed_events.py (100%) rename {src => poezio}/user.py (100%) rename {src => poezio}/windows/__init__.py (100%) rename {src => poezio}/windows/base_wins.py (98%) rename {src => poezio}/windows/bookmark_forms.py (100%) rename {src => poezio}/windows/data_forms.py (100%) rename {src => poezio}/windows/funcs.py (100%) rename {src => poezio}/windows/info_bar.py (100%) rename {src => poezio}/windows/info_wins.py (100%) rename {src => poezio}/windows/input_placeholders.py (100%) rename {src => poezio}/windows/inputs.py (100%) rename {src => poezio}/windows/list.py (100%) rename {src => poezio}/windows/misc.py (100%) rename {src => poezio}/windows/muc.py (100%) rename {src => poezio}/windows/roster_win.py (100%) rename {src => poezio}/windows/text_win.py (100%) rename {src => poezio}/xhtml.py (100%) delete mode 100644 src/__init__.py diff --git a/Makefile b/Makefile index 2b3e3a51..6b901279 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ clean: rm -rf poezio.egg-info rm -rf dist rm -rf build - rm -f src/*.so + rm -f poezio/*.so install: all python3 setup.py install --root=$(DESTDIR) --optimize=1 diff --git a/doc/source/conf.py b/doc/source/conf.py index 4ce97717..61f17b38 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -15,7 +15,7 @@ import sys, os, time sys.path.insert(0, os.path.abspath('../stub')) -sys.path.append(os.path.abspath('../../src/')) +sys.path.append(os.path.abspath('../../poezio/')) sys.path.append(os.path.abspath('../../plugins/')) # If extensions (or modules to document with autodoc) are in another directory, diff --git a/doc/source/keys.rst b/doc/source/keys.rst index ac4428e5..f1d47b91 100644 --- a/doc/source/keys.rst +++ b/doc/source/keys.rst @@ -249,7 +249,7 @@ To know exactly what the code of a key is, just run .. code-block:: bash - python3 src/keyboard.py + python3 poezio/keyboard.py And enter any key. diff --git a/launch.sh b/launch.sh index ca100524..267c90f4 100755 --- a/launch.sh +++ b/launch.sh @@ -25,5 +25,5 @@ else fi $PYTHON3 -c 'import sys;(print("Python 3.4 or newer is required") and exit(1)) if sys.version_info < (3, 4) else exit(0)' || exit 1 -exec "$PYTHON3" "$poezio_dir/src/poezio.py" -v "$args" "$@" +exec "$PYTHON3" "$poezio_dir/poezio/poezio.py" -v "$args" "$@" diff --git a/plugins/link.py b/plugins/link.py index d39d01b9..bca592a1 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -76,7 +76,7 @@ Options Set the default browser started by the plugin .. _Unix FIFO: https://en.wikipedia.org/wiki/Named_pipe -.. _daemon.py: http://dev.louiz.org/projects/poezio/repository/revisions/master/raw/src/daemon.py +.. _daemon.py: http://dev.louiz.org/projects/poezio/repository/revisions/master/raw/poezio/daemon.py """ import platform diff --git a/src/args.py b/poezio/args.py similarity index 100% rename from src/args.py rename to poezio/args.py diff --git a/src/bookmarks.py b/poezio/bookmarks.py similarity index 100% rename from src/bookmarks.py rename to poezio/bookmarks.py diff --git a/src/common.py b/poezio/common.py similarity index 100% rename from src/common.py rename to poezio/common.py diff --git a/src/config.py b/poezio/config.py similarity index 100% rename from src/config.py rename to poezio/config.py diff --git a/src/connection.py b/poezio/connection.py similarity index 100% rename from src/connection.py rename to poezio/connection.py diff --git a/src/contact.py b/poezio/contact.py similarity index 100% rename from src/contact.py rename to poezio/contact.py diff --git a/src/core/__init__.py b/poezio/core/__init__.py similarity index 100% rename from src/core/__init__.py rename to poezio/core/__init__.py diff --git a/src/core/commands.py b/poezio/core/commands.py similarity index 100% rename from src/core/commands.py rename to poezio/core/commands.py diff --git a/src/core/completions.py b/poezio/core/completions.py similarity index 100% rename from src/core/completions.py rename to poezio/core/completions.py diff --git a/src/core/core.py b/poezio/core/core.py similarity index 100% rename from src/core/core.py rename to poezio/core/core.py diff --git a/src/core/handlers.py b/poezio/core/handlers.py similarity index 100% rename from src/core/handlers.py rename to poezio/core/handlers.py diff --git a/src/core/structs.py b/poezio/core/structs.py similarity index 100% rename from src/core/structs.py rename to poezio/core/structs.py diff --git a/src/daemon.py b/poezio/daemon.py similarity index 100% rename from src/daemon.py rename to poezio/daemon.py diff --git a/src/decorators.py b/poezio/decorators.py similarity index 100% rename from src/decorators.py rename to poezio/decorators.py diff --git a/src/events.py b/poezio/events.py similarity index 100% rename from src/events.py rename to poezio/events.py diff --git a/src/fifo.py b/poezio/fifo.py similarity index 100% rename from src/fifo.py rename to poezio/fifo.py diff --git a/src/fixes.py b/poezio/fixes.py similarity index 100% rename from src/fixes.py rename to poezio/fixes.py diff --git a/src/keyboard.py b/poezio/keyboard.py similarity index 100% rename from src/keyboard.py rename to poezio/keyboard.py diff --git a/src/logger.py b/poezio/logger.py similarity index 100% rename from src/logger.py rename to poezio/logger.py diff --git a/src/multiuserchat.py b/poezio/multiuserchat.py similarity index 100% rename from src/multiuserchat.py rename to poezio/multiuserchat.py diff --git a/src/pep.py b/poezio/pep.py similarity index 100% rename from src/pep.py rename to poezio/pep.py diff --git a/src/plugin.py b/poezio/plugin.py similarity index 100% rename from src/plugin.py rename to poezio/plugin.py diff --git a/src/plugin_manager.py b/poezio/plugin_manager.py similarity index 100% rename from src/plugin_manager.py rename to poezio/plugin_manager.py diff --git a/src/poezio.py b/poezio/poezio.py similarity index 100% rename from src/poezio.py rename to poezio/poezio.py diff --git a/src/poezio_shlex.py b/poezio/poezio_shlex.py similarity index 100% rename from src/poezio_shlex.py rename to poezio/poezio_shlex.py diff --git a/src/pooptmodule.c b/poezio/pooptmodule.c similarity index 100% rename from src/pooptmodule.c rename to poezio/pooptmodule.c diff --git a/src/roster.py b/poezio/roster.py similarity index 100% rename from src/roster.py rename to poezio/roster.py diff --git a/src/roster_sorting.py b/poezio/roster_sorting.py similarity index 100% rename from src/roster_sorting.py rename to poezio/roster_sorting.py diff --git a/src/singleton.py b/poezio/singleton.py similarity index 100% rename from src/singleton.py rename to poezio/singleton.py diff --git a/src/size_manager.py b/poezio/size_manager.py similarity index 100% rename from src/size_manager.py rename to poezio/size_manager.py diff --git a/src/tabs/__init__.py b/poezio/tabs/__init__.py similarity index 100% rename from src/tabs/__init__.py rename to poezio/tabs/__init__.py diff --git a/src/tabs/adhoc_commands_list.py b/poezio/tabs/adhoc_commands_list.py similarity index 100% rename from src/tabs/adhoc_commands_list.py rename to poezio/tabs/adhoc_commands_list.py diff --git a/src/tabs/basetabs.py b/poezio/tabs/basetabs.py similarity index 100% rename from src/tabs/basetabs.py rename to poezio/tabs/basetabs.py diff --git a/src/tabs/bookmarkstab.py b/poezio/tabs/bookmarkstab.py similarity index 100% rename from src/tabs/bookmarkstab.py rename to poezio/tabs/bookmarkstab.py diff --git a/src/tabs/conversationtab.py b/poezio/tabs/conversationtab.py similarity index 100% rename from src/tabs/conversationtab.py rename to poezio/tabs/conversationtab.py diff --git a/src/tabs/data_forms.py b/poezio/tabs/data_forms.py similarity index 100% rename from src/tabs/data_forms.py rename to poezio/tabs/data_forms.py diff --git a/src/tabs/listtab.py b/poezio/tabs/listtab.py similarity index 100% rename from src/tabs/listtab.py rename to poezio/tabs/listtab.py diff --git a/src/tabs/muclisttab.py b/poezio/tabs/muclisttab.py similarity index 100% rename from src/tabs/muclisttab.py rename to poezio/tabs/muclisttab.py diff --git a/src/tabs/muctab.py b/poezio/tabs/muctab.py similarity index 100% rename from src/tabs/muctab.py rename to poezio/tabs/muctab.py diff --git a/src/tabs/privatetab.py b/poezio/tabs/privatetab.py similarity index 100% rename from src/tabs/privatetab.py rename to poezio/tabs/privatetab.py diff --git a/src/tabs/rostertab.py b/poezio/tabs/rostertab.py similarity index 100% rename from src/tabs/rostertab.py rename to poezio/tabs/rostertab.py diff --git a/src/tabs/xmltab.py b/poezio/tabs/xmltab.py similarity index 100% rename from src/tabs/xmltab.py rename to poezio/tabs/xmltab.py diff --git a/src/text_buffer.py b/poezio/text_buffer.py similarity index 100% rename from src/text_buffer.py rename to poezio/text_buffer.py diff --git a/src/theming.py b/poezio/theming.py similarity index 100% rename from src/theming.py rename to poezio/theming.py diff --git a/src/timed_events.py b/poezio/timed_events.py similarity index 100% rename from src/timed_events.py rename to poezio/timed_events.py diff --git a/src/user.py b/poezio/user.py similarity index 100% rename from src/user.py rename to poezio/user.py diff --git a/src/windows/__init__.py b/poezio/windows/__init__.py similarity index 100% rename from src/windows/__init__.py rename to poezio/windows/__init__.py diff --git a/src/windows/base_wins.py b/poezio/windows/base_wins.py similarity index 98% rename from src/windows/base_wins.py rename to poezio/windows/base_wins.py index 464c6fa1..8df214d2 100644 --- a/src/windows/base_wins.py +++ b/poezio/windows/base_wins.py @@ -4,7 +4,7 @@ by the file of this module. A window is a little part of the screen, for example the input window, the text window, the roster window, etc. -A Tab (see the src/tabs module) is composed of multiple Windows +A Tab (see the poezio.tabs module) is composed of multiple Windows """ import logging diff --git a/src/windows/bookmark_forms.py b/poezio/windows/bookmark_forms.py similarity index 100% rename from src/windows/bookmark_forms.py rename to poezio/windows/bookmark_forms.py diff --git a/src/windows/data_forms.py b/poezio/windows/data_forms.py similarity index 100% rename from src/windows/data_forms.py rename to poezio/windows/data_forms.py diff --git a/src/windows/funcs.py b/poezio/windows/funcs.py similarity index 100% rename from src/windows/funcs.py rename to poezio/windows/funcs.py diff --git a/src/windows/info_bar.py b/poezio/windows/info_bar.py similarity index 100% rename from src/windows/info_bar.py rename to poezio/windows/info_bar.py diff --git a/src/windows/info_wins.py b/poezio/windows/info_wins.py similarity index 100% rename from src/windows/info_wins.py rename to poezio/windows/info_wins.py diff --git a/src/windows/input_placeholders.py b/poezio/windows/input_placeholders.py similarity index 100% rename from src/windows/input_placeholders.py rename to poezio/windows/input_placeholders.py diff --git a/src/windows/inputs.py b/poezio/windows/inputs.py similarity index 100% rename from src/windows/inputs.py rename to poezio/windows/inputs.py diff --git a/src/windows/list.py b/poezio/windows/list.py similarity index 100% rename from src/windows/list.py rename to poezio/windows/list.py diff --git a/src/windows/misc.py b/poezio/windows/misc.py similarity index 100% rename from src/windows/misc.py rename to poezio/windows/misc.py diff --git a/src/windows/muc.py b/poezio/windows/muc.py similarity index 100% rename from src/windows/muc.py rename to poezio/windows/muc.py diff --git a/src/windows/roster_win.py b/poezio/windows/roster_win.py similarity index 100% rename from src/windows/roster_win.py rename to poezio/windows/roster_win.py diff --git a/src/windows/text_win.py b/poezio/windows/text_win.py similarity index 100% rename from src/windows/text_win.py rename to poezio/windows/text_win.py diff --git a/src/xhtml.py b/poezio/xhtml.py similarity index 100% rename from src/xhtml.py rename to poezio/xhtml.py diff --git a/setup.py b/setup.py index 051bcf8b..775b5fb9 100755 --- a/setup.py +++ b/setup.py @@ -38,12 +38,12 @@ def find_doc(before, path): module_poopt = Extension('poezio.poopt', extra_compile_args=['-Wno-declaration-after-statement'], - sources=['src/pooptmodule.c']) + sources=['poezio/pooptmodule.c']) # Create a link to the config file (for packaging purposes) -if not exists(join(current_dir, 'src', 'default_config.cfg')): +if not exists(join(current_dir, 'poezio', 'default_config.cfg')): link(join(current_dir, 'data', 'default_config.cfg'), - join(current_dir, 'src', 'default_config.cfg')) + join(current_dir, 'poezio', 'default_config.cfg')) # identify the git version git_dir = join(current_dir, '.git') @@ -91,7 +91,7 @@ setup(name="poezio", keywords=['jabber', 'xmpp', 'client', 'chat', 'im', 'console'], packages=['poezio', 'poezio.core', 'poezio.tabs', 'poezio.windows', 'poezio_plugins', 'poezio_plugins.gpg', 'poezio_themes'], - package_dir={'poezio': 'src', + package_dir={'poezio': 'poezio', 'poezio_plugins': 'plugins', 'poezio_themes': 'data/themes'}, package_data={'poezio': ['default_config.cfg']}, @@ -106,8 +106,8 @@ setup(name="poezio", 'Screen autoaway plugin': 'pyinotify==0.9.4'}) # Remove the link afterwards -if (exists(join(current_dir, 'src', 'default_config.cfg')) and +if (exists(join(current_dir, 'poezio', 'default_config.cfg')) and exists(join(current_dir, 'data', 'default_config.cfg'))): - unlink(join(current_dir, 'src', 'default_config.cfg')) + unlink(join(current_dir, 'poezio', 'default_config.cfg')) diff --git a/src/__init__.py b/src/__init__.py deleted file mode 100644 index 9fdbcc02..00000000 --- a/src/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from poezio.poezio import main diff --git a/test/test_common.py b/test/test_common.py index 0b2bd279..97727aaf 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -3,7 +3,7 @@ Test the functions in the `common` module """ import sys -sys.path.append('src') +sys.path.append('poezio') import time import pytest diff --git a/test/test_completion.py b/test/test_completion.py index 0e6e0492..54c0f057 100644 --- a/test/test_completion.py +++ b/test/test_completion.py @@ -8,7 +8,7 @@ import random import sys import os -sys.path.append('src') +sys.path.append('poezio') class ConfigShim(object): def get(self, *args, **kwargs): diff --git a/test/test_config.py b/test/test_config.py index f8d06258..4c87458e 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -8,7 +8,7 @@ import sys import os -sys.path.append('src') +sys.path.append('poezio') import config diff --git a/test/test_poopt.py b/test/test_poopt.py index 9b640ff0..54f466a6 100644 --- a/test/test_poopt.py +++ b/test/test_poopt.py @@ -4,7 +4,7 @@ Test of the poopt module import pytest import sys -sys.path.append('src') +sys.path.append('poezio') from poopt import cut_text diff --git a/test/test_theming.py b/test/test_theming.py index 9cdb4829..b59560b7 100644 --- a/test/test_theming.py +++ b/test/test_theming.py @@ -4,7 +4,7 @@ Test the functions in the `theming` module import sys import pytest -sys.path.append('src') +sys.path.append('poezio') from theming import dump_tuple, read_tuple diff --git a/test/test_windows.py b/test/test_windows.py index 8fb85295..26a426c7 100644 --- a/test/test_windows.py +++ b/test/test_windows.py @@ -1,6 +1,6 @@ import pytest import sys -sys.path.append('src') +sys.path.append('poezio') class ConfigShim(object): def get(self, *args, **kwargs): diff --git a/test/test_xhtml.py b/test/test_xhtml.py index 5afd08ff..b4d6c3da 100644 --- a/test/test_xhtml.py +++ b/test/test_xhtml.py @@ -5,7 +5,7 @@ Test the functions in the `xhtml` module import pytest import sys import xml -sys.path.append('src') +sys.path.append('poezio') from xhtml import (poezio_colors_to_html, xhtml_to_poezio_colors, parse_css, clean_text) diff --git a/update.sh b/update.sh index 73c37467..dd9d846f 100755 --- a/update.sh +++ b/update.sh @@ -64,13 +64,3 @@ else fi make - - -if [ -e src/slixmpp ] -then - echo "" - echo "The update script detected a slixmpp link in src/." - echo "This is probably due to the old update script, you should delete it" - echo "so that poezio can use the up-to-date copy inside the poezio-venv directory." - echo "" -fi