From 252c260f06c07d745b97cbfc37c86b446b2c171e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 01/10] use entropy_path_loader only for running from the checkout After this commit alone it would not work when installed (unless module paths are set in a special way). Next changes will introduce installation to site-packages so no custom PYTHONPATH will be necessary. --- client/doc/generate | 4 +--- client/equo.py | 4 +--- client/kernel-switcher | 4 +--- entropy_path_loader/entropy_path_loader.py | 23 +++++++--------------- lib/Makefile | 1 - magneto/src/magneto_app.py | 9 +++------ matter/antimatter.py | 4 +--- matter/matter/binpms/entropysrv.py | 4 +--- matter/matter_app.py | 7 ++----- rigo/RigoDaemon/app/RigoDaemon_app.py | 7 ++----- rigo/rigo_app.py | 7 ++----- server/doc/generate | 4 +--- server/eit.py | 4 +--- services/entropy-pkgdelta-generator | 4 +--- services/entropy-repository-statistics | 4 +--- services/portage-repository-converter | 4 +--- services/repository-webinstall-generator | 4 +--- 17 files changed, 27 insertions(+), 71 deletions(-) diff --git a/client/doc/generate b/client/doc/generate index b18d79ce9..9c6d84f85 100755 --- a/client/doc/generate +++ b/client/doc/generate @@ -10,10 +10,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.dirname(osp.realpath(__file__)))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader from solo.commands.descriptor import SoloCommandDescriptor diff --git a/client/equo.py b/client/equo.py index 5f7ed1702..c0f0d15f1 100755 --- a/client/equo.py +++ b/client/equo.py @@ -8,10 +8,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader from solo.main import main sys.argv[0] = "equo" diff --git a/client/kernel-switcher b/client/kernel-switcher index 8f5e194db..3c6e06962 100755 --- a/client/kernel-switcher +++ b/client/kernel-switcher @@ -6,10 +6,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader import argparse diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index e8398194f..60bdaab1f 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -8,8 +8,9 @@ B{Python module path setter}. - This is a module that sets paths to other modules, which can be installed - on system or taken from sources checkout. + This module sets paths to other modules from sources checkout. + It must not be imported in case of installed application, system wide or + otherwise. """ import sys @@ -18,22 +19,12 @@ from os import path as osp base_dir = osp.dirname(osp.dirname(osp.realpath(__file__))) in_checkout = osp.isfile(osp.join(base_dir, "entropy-in-vcs-checkout")) -# Ugly, can go away if paths are in sys.path. -mods_outside_entropy_dir = set([ - "rigo", - "matter" -]) - def add_import_path(mod): - if in_checkout: - base = base_dir - elif mod in mods_outside_entropy_dir: - base = "/usr/lib" - else: - base = "/usr/lib/entropy" - - lib = osp.join(base, mod) + if not in_checkout: + raise RuntimeError( + "entropy_path_loader used when not in checkout") + lib = osp.join(base_dir, mod) sys.path.insert(0, lib) diff --git a/lib/Makefile b/lib/Makefile index 5d9cfb583..59d9891d3 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -62,7 +62,6 @@ install: install -m 644 ../misc/05entropy.envd $(DESTDIR)/etc/env.d/05entropy install -m 644 ../docs/COPYING $(DESTDIR)/$(LIBDIR)/entropy/ - cp ../entropy_path_loader $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/ -Ra install -m 644 ../conf/entropy-tmpfiles.d.conf $(DESTDIR)/$(TMPFILESDIR)/entropy.conf diff --git a/magneto/src/magneto_app.py b/magneto/src/magneto_app.py index bfb39c84b..8b60b6d73 100755 --- a/magneto/src/magneto_app.py +++ b/magneto/src/magneto_app.py @@ -20,13 +20,10 @@ _base = osp.dirname( osp.dirname(osp.dirname(osp.realpath(__file__)))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader + entropy_path_loader.add_import_path("rigo") + entropy_path_loader.add_import_path("magneto") del osp -import entropy_path_loader - -entropy_path_loader.add_import_path("rigo") -entropy_path_loader.add_import_path("magneto") from entropy.locks import SimpleFileLock diff --git a/matter/antimatter.py b/matter/antimatter.py index abf364fee..a8356e628 100755 --- a/matter/antimatter.py +++ b/matter/antimatter.py @@ -14,10 +14,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader # Entropy imports from entropy.output import print_info, print_error, print_warning, \ diff --git a/matter/matter/binpms/entropysrv.py b/matter/matter/binpms/entropysrv.py index 746b184ec..5680436b9 100644 --- a/matter/matter/binpms/entropysrv.py +++ b/matter/matter/binpms/entropysrv.py @@ -33,10 +33,8 @@ _base = osp.dirname( osp.dirname(osp.dirname(osp.dirname(osp.realpath(__file__))))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader from entropy.exceptions import PermissionDenied, OnlineMirrorError from entropy.server.interfaces import Server diff --git a/matter/matter_app.py b/matter/matter_app.py index 05c2b80ff..a6cd67e30 100755 --- a/matter/matter_app.py +++ b/matter/matter_app.py @@ -17,12 +17,9 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader + entropy_path_loader.add_import_path("matter") del osp -import entropy_path_loader - -entropy_path_loader.add_import_path("matter") from matter.main import main diff --git a/rigo/RigoDaemon/app/RigoDaemon_app.py b/rigo/RigoDaemon/app/RigoDaemon_app.py index 701769763..4b2401777 100755 --- a/rigo/RigoDaemon/app/RigoDaemon_app.py +++ b/rigo/RigoDaemon/app/RigoDaemon_app.py @@ -57,12 +57,9 @@ _base = osp.dirname(osp.dirname( osp.dirname(osp.dirname(osp.realpath(__file__))))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader + entropy_path_loader.add_import_path("rigo") del osp -import entropy_path_loader - -entropy_path_loader.add_import_path("rigo") from entropy.cache import EntropyCacher # update default writeback timeout diff --git a/rigo/rigo_app.py b/rigo/rigo_app.py index 7d3cf8431..f35708f21 100644 --- a/rigo/rigo_app.py +++ b/rigo/rigo_app.py @@ -33,12 +33,9 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader + entropy_path_loader.add_import_path("rigo") del osp -import entropy_path_loader - -entropy_path_loader.add_import_path("rigo") from gi.repository import Gtk, Gdk, GLib diff --git a/server/doc/generate b/server/doc/generate index 5aef4097d..b2c87cd10 100755 --- a/server/doc/generate +++ b/server/doc/generate @@ -10,10 +10,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.dirname(osp.realpath(__file__)))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader from eit.commands.descriptor import EitCommandDescriptor diff --git a/server/eit.py b/server/eit.py index 6b42cea65..6324ffea4 100755 --- a/server/eit.py +++ b/server/eit.py @@ -8,10 +8,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader from eit.main import main sys.argv[0] = "eit" diff --git a/services/entropy-pkgdelta-generator b/services/entropy-pkgdelta-generator index 5d1141c2d..bb73efb38 100755 --- a/services/entropy-pkgdelta-generator +++ b/services/entropy-pkgdelta-generator @@ -9,10 +9,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader import tempfile import subprocess diff --git a/services/entropy-repository-statistics b/services/entropy-repository-statistics index 17183a0cf..d852a8991 100755 --- a/services/entropy-repository-statistics +++ b/services/entropy-repository-statistics @@ -16,10 +16,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader from entropy.const import etpConst from entropy.client.interfaces import Client diff --git a/services/portage-repository-converter b/services/portage-repository-converter index 3f499262b..7aa17e65f 100755 --- a/services/portage-repository-converter +++ b/services/portage-repository-converter @@ -6,10 +6,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader import tempfile diff --git a/services/repository-webinstall-generator b/services/repository-webinstall-generator index 40277adb6..cd943cace 100755 --- a/services/repository-webinstall-generator +++ b/services/repository-webinstall-generator @@ -6,10 +6,8 @@ from os import path as osp _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) -else: - sys.path.insert(0, "/usr/lib/entropy/entropy_path_loader") + import entropy_path_loader del osp -import entropy_path_loader import time import tempfile From 6d4a3f09e6fd0beddaa567ffa9aef8d10d236f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 02/10] makefiles: establish a layout for sitedir installs The idea is that: - entropy.* imports will work as before (so any 3rd party clients will work as always) - installed in "entropy" package, - new "_entropy" package to hold a namespace for private modules (like ones that required adding special directories to sys.path). (Underscored name for a top level Python module is not very common... anyway, it was inspired by "_emerge.") Layout: site-packages/ entropy (backwards compatible) const.py ... kswitch (also toplevel to keep compatibility) ... _entropy eit magneto matter rigo RigoDaemon solo (Note that site-packages does not need to be actually Python's site-packages directory but anything as it is controlled by an argument to make. It is however intended to be the sitedir.) Another idea for a layout would be one that mimics sources checkout, but the layout there is somewhat scattered. (And some ugliness would be needed to make them modules before implicit namespaces from Python 3.3. Anyway, imports would be long and ugly.) Now, the layout of installed Entropy is lean; installation to virtualenv is also possible (though there would be a need to call scripts like "python equo.py" as shebangs are not converted). Follow up changes are needed to make it work. --- client/Makefile | 6 +++--- lib/Makefile | 12 +++++++----- lib/kswitch/Makefile | 4 ++-- magneto/Makefile | 18 +++++++++--------- matter/Makefile | 2 +- rigo/Makefile | 2 +- rigo/RigoDaemon/Makefile | 4 ++-- server/Makefile | 4 ++-- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/client/Makefile b/client/Makefile index 638833e7c..37670f918 100644 --- a/client/Makefile +++ b/client/Makefile @@ -11,7 +11,7 @@ all: install: install -d $(DESTDIR)/$(LIBDIR)/entropy/client - install -d $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/client/solo/commands + install -d $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/solo/commands install -d -m 775 $(DESTDIR)/etc/entropy install -d $(DESTDIR)$(BINDIR) install -d $(DESTDIR)$(PREFIX)/share/man/man1 @@ -19,8 +19,8 @@ install: # copying portage bashrc install -m 644 ../conf/client.conf $(DESTDIR)/etc/entropy/ - install -m 644 solo/*.py $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/client/solo/ - install -m 644 solo/commands/*.py $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/client/solo/commands/ + install -m 644 solo/*.py $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/solo/ + install -m 644 solo/commands/*.py $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/solo/commands/ install -m 644 revision $(DESTDIR)/$(LIBDIR)/entropy/client/ install -m 755 equo.py $(DESTDIR)/$(BINDIR)/equo install -m 755 kernel-switcher $(DESTDIR)/$(BINDIR)/ diff --git a/lib/Makefile b/lib/Makefile index 59d9891d3..41659afb8 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -13,16 +13,19 @@ all: install: install -d $(DESTDIR)/$(LIBDIR)/entropy/lib/entropy - install -d $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/lib + install -d $(DESTDIR)/$(PYTHON_SITEDIR) + install -d $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy install -d $(DESTDIR)$(PREFIX)/sbin install -d $(DESTDIR)$(BINDIR) install -d -m 775 $(DESTDIR)/etc/entropy install -d $(DESTDIR)/etc/env.d install -d $(DESTDIR)/etc/init.d install -d $(DESTDIR)/etc/logrotate.d - install -d $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/services install -d $(DESTDIR)/$(TMPFILESDIR) + # Make it a package + touch $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/__init__.py + # Empty directories that should be created and kept install -d -m 775 $(DESTDIR)$(VARDIR)/tmp/entropy touch $(DESTDIR)$(VARDIR)/tmp/entropy/.keep @@ -37,11 +40,10 @@ install: touch $(DESTDIR)/$(VARDIR)/log/entropy/.keep chmod +x entropy/spm/plugins/interfaces/portage_plugin/env_sourcer.sh - cp -Ra entropy $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/lib/ - rm $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/lib/entropy/revision + cp -Ra entropy $(DESTDIR)/$(PYTHON_SITEDIR) + rm $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/revision install -m 644 entropy/revision $(DESTDIR)/$(LIBDIR)/entropy/lib/entropy/ - ln -sf lib $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/libraries install -m 755 ../misc/entropy.sh $(DESTDIR)$(PREFIX)/sbin/ install -m 755 ../misc/entropy_hwgen.sh $(DESTDIR)$(BINDIR)/ install -m 644 ../misc/entropy.logrotate $(DESTDIR)/etc/logrotate.d/entropy diff --git a/lib/kswitch/Makefile b/lib/kswitch/Makefile index 00475e992..4a13166ab 100644 --- a/lib/kswitch/Makefile +++ b/lib/kswitch/Makefile @@ -8,7 +8,7 @@ all: install: - install -d $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/lib/kswitch - install -m 644 *.py $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/lib/kswitch/ + install -d $(DESTDIR)/$(PYTHON_SITEDIR)/kswitch + install -m 644 *.py $(DESTDIR)/$(PYTHON_SITEDIR)/kswitch/ clean: diff --git a/magneto/Makefile b/magneto/Makefile index ffc56068b..e004470ba 100644 --- a/magneto/Makefile +++ b/magneto/Makefile @@ -14,11 +14,11 @@ all: magneto-core-install: mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps/magneto mkdir -p $(DESTDIR)$(PREFIX)/share/magneto/icons - mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/core + mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/core install -m644 src/magneto/*.py \ - $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/. + $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/. install -m644 src/magneto/core/*.py \ - $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/core/. + $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/core/. install -m644 $(PIXDIR)/* $(DESTDIR)$(PREFIX)/share/pixmaps/magneto/. install -m644 $(ICONDIR)/* $(DESTDIR)$(PREFIX)/share/magneto/icons/. @@ -34,26 +34,26 @@ magneto-loader-install: magneto-gtk-install: mkdir -p $(DESTDIR)/$(LIBDIR)/entropy/magneto/magneto/gtk - mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/gtk + mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/gtk install -m644 src/magneto/gtk/*.py \ - $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/gtk/. + $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/gtk/. install -m644 src/magneto/gtk/*.glade \ $(DESTDIR)/$(LIBDIR)/entropy/magneto/magneto/gtk/. magneto-gtk3-install: mkdir -p $(DESTDIR)/$(LIBDIR)/entropy/magneto/magneto/gtk3 - mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/gtk3 + mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/gtk3 install -m644 src/magneto/gtk3/*.py \ - $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/gtk3/. + $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/gtk3/. install -m644 src/magneto/gtk3/*.ui \ $(DESTDIR)/$(LIBDIR)/entropy/magneto/magneto/gtk3/. magneto-kde-install: - mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/qt5 + mkdir -p $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/qt5 mkdir -p $(DESTDIR)$(PREFIX)/share/apps/magneto install -m644 src/magneto/qt5/*.py \ - $(DESTDIR)/$(PYTHON_SITEDIR)/entropy/magneto/magneto/qt5/. + $(DESTDIR)/$(PYTHON_SITEDIR)/_entropy/magneto/qt5/. # install Magneto notification service install -m644 $(MISCDIR)/magneto.notifyrc \ $(DESTDIR)$(PREFIX)/share/apps/magneto/. diff --git a/matter/Makefile b/matter/Makefile index 4ae21aeb5..a50b88772 100644 --- a/matter/Makefile +++ b/matter/Makefile @@ -4,7 +4,7 @@ LIBDIR = $(PREFIX)/lib PYTHON_SITEDIR = $(LIBDIR) SBINDIR = $(PREFIX)/sbin DESTDIR = -MATTER_PYDIR = $(DESTDIR)$(PYTHON_SITEDIR)/matter +MATTER_PYDIR = $(DESTDIR)$(PYTHON_SITEDIR)/_entropy all: for d in $(SUBDIRS); do $(MAKE) -C $$d; done diff --git a/rigo/Makefile b/rigo/Makefile index 0f84f3491..ded5bd54f 100644 --- a/rigo/Makefile +++ b/rigo/Makefile @@ -3,7 +3,7 @@ PREFIX = /usr BINDIR = $(PREFIX)/bin LIBDIR = $(PREFIX)/lib PYTHON_SITEDIR = $(LIBDIR) -RIGO_PYDIR = $(PYTHON_SITEDIR)/rigo +RIGO_PYDIR = $(PYTHON_SITEDIR)/_entropy DESTDIR = all: diff --git a/rigo/RigoDaemon/Makefile b/rigo/RigoDaemon/Makefile index 155cabcc8..179a43a6f 100644 --- a/rigo/RigoDaemon/Makefile +++ b/rigo/RigoDaemon/Makefile @@ -11,8 +11,8 @@ all: install: install -d $(DESTDIR)$(LIBEXECDIR) - install -d $(DESTDIR)$(PYTHON_SITEDIR)/rigo/RigoDaemon - install -m 644 $(wildcard *.py) $(DESTDIR)$(PYTHON_SITEDIR)/rigo/RigoDaemon/ + install -d $(DESTDIR)$(PYTHON_SITEDIR)/_entropy/RigoDaemon + install -m 644 $(wildcard *.py) $(DESTDIR)$(PYTHON_SITEDIR)/_entropy/RigoDaemon/ install -m 755 app/RigoDaemon_app.py $(DESTDIR)$(LIBEXECDIR)/ for d in $(SUBDIRS); do $(MAKE) -C $$d install; done diff --git a/server/Makefile b/server/Makefile index 6eb92bde5..1d65875e1 100644 --- a/server/Makefile +++ b/server/Makefile @@ -9,13 +9,13 @@ all: for d in $(SUBDIRS); do $(MAKE) -C $$d; done install: - mkdir -p $(DESTDIR)$(PYTHON_SITEDIR)/entropy/server + mkdir -p $(DESTDIR)$(PYTHON_SITEDIR)/_entropy mkdir -p $(DESTDIR)/etc/entropy mkdir -p $(DESTDIR)$(BINDIR) install -m 644 ../conf/server.conf.example $(DESTDIR)/etc/entropy/ - cp -R eit $(DESTDIR)$(PYTHON_SITEDIR)/entropy/server/ + cp -R eit $(DESTDIR)$(PYTHON_SITEDIR)/_entropy/ install -m 755 eit.py $(DESTDIR)$(BINDIR)/eit for d in $(SUBDIRS); do $(MAKE) -C $$d install; done From 7cf7e1f6b7cbce4d7f5094ab4d2f1cb6023f7d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 03/10] convert solo imports, with needed changes to entropy_path_loader The module entropy_path_loader (used only for running from within the checkout; otherwise not even installed) is made to provide the _entropy namespace. (Other ideas instead of this entropy_path_loader change would be to reorganise files layout; drop support for running from the checkout as is - and perhaps require virtualenvs; require sourcing a script that sets PYTHONPATH. However, as implemented, it is not intrusive, and the good part is that it is quite isolated, not used in normal usage after installation. Basically, it only does sys.path + provides _entropy namespace.) --- client/doc/generate | 2 +- client/equo.py | 2 +- client/kernel-switcher | 4 ++-- client/solo/commands/__init__.py | 2 +- client/solo/commands/_manage.py | 4 ++-- client/solo/commands/cache.py | 4 ++-- client/solo/commands/cleanup.py | 6 +++--- client/solo/commands/command.py | 2 +- client/solo/commands/conf.py | 4 ++-- client/solo/commands/config.py | 6 +++--- client/solo/commands/deptest.py | 4 ++-- client/solo/commands/download.py | 4 ++-- client/solo/commands/help.py | 6 +++--- client/solo/commands/hop.py | 4 ++-- client/solo/commands/install.py | 6 +++--- client/solo/commands/libtest.py | 4 ++-- client/solo/commands/mark.py | 4 ++-- client/solo/commands/mask.py | 6 +++--- client/solo/commands/match.py | 6 +++--- client/solo/commands/moo.py | 4 ++-- client/solo/commands/notice.py | 4 ++-- client/solo/commands/pkg.py | 4 ++-- client/solo/commands/preservedlibs.py | 6 +++--- client/solo/commands/query.py | 10 +++++----- client/solo/commands/remove.py | 6 +++--- client/solo/commands/repo.py | 6 +++--- client/solo/commands/rescue.py | 5 +++-- client/solo/commands/search.py | 6 +++--- client/solo/commands/security.py | 6 +++--- client/solo/commands/source.py | 4 ++-- client/solo/commands/status.py | 4 ++-- client/solo/commands/ugc.py | 6 +++--- client/solo/commands/unused.py | 4 ++-- client/solo/commands/update.py | 4 ++-- client/solo/commands/upgrade.py | 6 +++--- client/solo/commands/version.py | 6 +++--- client/solo/commands/yell.py | 4 ++-- client/solo/main.py | 4 ++-- entropy_path_loader/compat/_entropy/__init__.py | 4 ++++ entropy_path_loader/entropy_path_loader.py | 3 ++- lib/tests/client.py | 2 +- 41 files changed, 97 insertions(+), 91 deletions(-) create mode 100644 entropy_path_loader/compat/_entropy/__init__.py diff --git a/client/doc/generate b/client/doc/generate index 9c6d84f85..3d6fb3b8d 100755 --- a/client/doc/generate +++ b/client/doc/generate @@ -13,7 +13,7 @@ if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): import entropy_path_loader del osp -from solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.descriptor import SoloCommandDescriptor MAN_HEADER="""\ EQUO(1) diff --git a/client/equo.py b/client/equo.py index c0f0d15f1..2566c980b 100755 --- a/client/equo.py +++ b/client/equo.py @@ -11,6 +11,6 @@ if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): import entropy_path_loader del osp -from solo.main import main +from _entropy.solo.main import main sys.argv[0] = "equo" main() diff --git a/client/kernel-switcher b/client/kernel-switcher index 3c6e06962..4fdf86ff3 100755 --- a/client/kernel-switcher +++ b/client/kernel-switcher @@ -18,8 +18,8 @@ from entropy.client.interfaces import Client import entropy.dep import entropy.tools -from solo.commands.install import SoloInstall -from solo.utils import print_package_info +from _entropy.solo.commands.install import SoloInstall +from _entropy.solo.utils import print_package_info import kswitch diff --git a/client/solo/commands/__init__.py b/client/solo/commands/__init__.py index 138234635..f0fa28923 100644 --- a/client/solo/commands/__init__.py +++ b/client/solo/commands/__init__.py @@ -21,7 +21,7 @@ for py_file in os.listdir(_cur_dir): if py_file.startswith("_"): continue # strip .py - _mod = "solo.commands." + py_file[:-3] + _mod = "_entropy.solo.commands." + py_file[:-3] if _mod in _excluded_mods: continue try: diff --git a/client/solo/commands/_manage.py b/client/solo/commands/_manage.py index 199daaa92..bfb4fa663 100644 --- a/client/solo/commands/_manage.py +++ b/client/solo/commands/_manage.py @@ -30,8 +30,8 @@ from entropy.client.interfaces.package.preservedlibs import PreservedLibraries import entropy.tools import entropy.dep -from solo.utils import enlightenatom, get_entropy_webservice -from solo.commands.command import SoloCommand +from _entropy.solo.utils import enlightenatom, get_entropy_webservice +from _entropy.solo.commands.command import SoloCommand class SoloManage(SoloCommand): """ diff --git a/client/solo/commands/cache.py b/client/solo/commands/cache.py index 80f267be1..3334b7ed1 100644 --- a/client/solo/commands/cache.py +++ b/client/solo/commands/cache.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ from entropy.output import blue, brown, darkgreen -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock class SoloCache(SoloCommand): """ diff --git a/client/solo/commands/cleanup.py b/client/solo/commands/cleanup.py index e1d54ff9e..389bcb0c9 100644 --- a/client/solo/commands/cleanup.py +++ b/client/solo/commands/cleanup.py @@ -16,9 +16,9 @@ import argparse from entropy.i18n import _ from entropy.const import etpConst -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand -from solo.utils import cleanup +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand +from _entropy.solo.utils import cleanup class SoloCleanup(SoloCommand): """ diff --git a/client/solo/commands/command.py b/client/solo/commands/command.py index fd391ccf7..e81c0b29d 100644 --- a/client/solo/commands/command.py +++ b/client/solo/commands/command.py @@ -26,7 +26,7 @@ from entropy.core.settings.base import SystemSettings import entropy.tools -from solo.utils import enlightenatom +from _entropy.solo.utils import enlightenatom def _fix_argparse_print_help(): diff --git a/client/solo/commands/conf.py b/client/solo/commands/conf.py index 435e544d5..dd33adfcd 100644 --- a/client/solo/commands/conf.py +++ b/client/solo/commands/conf.py @@ -28,8 +28,8 @@ from entropy.output import readtext, darkgreen, brown, teal, purple, \ import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloConf(SoloCommand): diff --git a/client/solo/commands/config.py b/client/solo/commands/config.py index eceb81423..89cef029a 100644 --- a/client/solo/commands/config.py +++ b/client/solo/commands/config.py @@ -16,9 +16,9 @@ import argparse from entropy.i18n import _ from entropy.output import darkred, darkgreen, blue, brown -from solo.utils import enlightenatom -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands._manage import SoloManage +from _entropy.solo.utils import enlightenatom +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands._manage import SoloManage class SoloConfig(SoloManage): """ diff --git a/client/solo/commands/deptest.py b/client/solo/commands/deptest.py index 97d5021bb..78202c48b 100644 --- a/client/solo/commands/deptest.py +++ b/client/solo/commands/deptest.py @@ -16,8 +16,8 @@ import time from entropy.i18n import _ from entropy.output import darkred, blue, darkgreen -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.install import SoloInstall +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.install import SoloInstall class SoloDeptest(SoloInstall): """ diff --git a/client/solo/commands/download.py b/client/solo/commands/download.py index 8b6bf274f..630a91354 100644 --- a/client/solo/commands/download.py +++ b/client/solo/commands/download.py @@ -16,8 +16,8 @@ import argparse from entropy.i18n import _ from entropy.output import darkred, darkgreen, blue -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands._manage import SoloManage +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands._manage import SoloManage class SoloDownload(SoloManage): """ diff --git a/client/solo/commands/help.py b/client/solo/commands/help.py index a553ddaba..a749b91bc 100644 --- a/client/solo/commands/help.py +++ b/client/solo/commands/help.py @@ -14,9 +14,9 @@ import argparse from entropy.i18n import _ from entropy.output import teal, purple, darkgreen -from solo.colorful import ColorfulFormatter -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.colorful import ColorfulFormatter +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloHelp(SoloCommand): """ diff --git a/client/solo/commands/hop.py b/client/solo/commands/hop.py index e74e1105a..bad01d8cc 100644 --- a/client/solo/commands/hop.py +++ b/client/solo/commands/hop.py @@ -16,8 +16,8 @@ from entropy.i18n import _ from entropy.output import brown, purple, teal, darkred, bold, \ red, darkgreen -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, exclusivelock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, exclusivelock class SoloHop(SoloCommand): """ diff --git a/client/solo/commands/install.py b/client/solo/commands/install.py index 4d1f725c4..8e13c698f 100644 --- a/client/solo/commands/install.py +++ b/client/solo/commands/install.py @@ -23,9 +23,9 @@ from entropy.client.interfaces.package.actions.action import PackageAction import entropy.tools -from solo.utils import enlightenatom -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands._manage import SoloManage +from _entropy.solo.utils import enlightenatom +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands._manage import SoloManage class SoloInstall(SoloManage): """ diff --git a/client/solo/commands/libtest.py b/client/solo/commands/libtest.py index e133aeb4f..dea5b7f8f 100644 --- a/client/solo/commands/libtest.py +++ b/client/solo/commands/libtest.py @@ -16,8 +16,8 @@ import time from entropy.i18n import _ from entropy.output import blue, darkred, brown, purple, teal, darkgreen -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.install import SoloInstall +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.install import SoloInstall class SoloLibtest(SoloInstall): """ diff --git a/client/solo/commands/mark.py b/client/solo/commands/mark.py index 7521308e7..46bb6291e 100644 --- a/client/solo/commands/mark.py +++ b/client/solo/commands/mark.py @@ -16,8 +16,8 @@ from entropy.i18n import _ from entropy.const import etpConst, const_convert_to_unicode from entropy.output import darkred, red, blue, brown, teal, purple -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, exclusivelock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, exclusivelock class SoloMark(SoloCommand): diff --git a/client/solo/commands/mask.py b/client/solo/commands/mask.py index 152bd24b4..f55fca820 100644 --- a/client/solo/commands/mask.py +++ b/client/solo/commands/mask.py @@ -17,9 +17,9 @@ from entropy.const import const_convert_to_unicode from entropy.output import purple, teal, darkred, brown, red, \ darkgreen, blue -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand -from solo.utils import enlightenatom +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand +from _entropy.solo.utils import enlightenatom class SoloMaskUnmask(SoloCommand): diff --git a/client/solo/commands/match.py b/client/solo/commands/match.py index 89b2b9ccb..4c2e4e0bb 100644 --- a/client/solo/commands/match.py +++ b/client/solo/commands/match.py @@ -15,9 +15,9 @@ import argparse from entropy.i18n import _, ngettext from entropy.output import darkred, blue, brown, darkgreen, purple -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock -from solo.utils import print_table, print_package_info +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.utils import print_table, print_package_info import entropy.dep diff --git a/client/solo/commands/moo.py b/client/solo/commands/moo.py index e410cdaf2..c16bd3dad 100644 --- a/client/solo/commands/moo.py +++ b/client/solo/commands/moo.py @@ -13,8 +13,8 @@ import argparse from entropy.i18n import _ -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloFunny(SoloCommand): diff --git a/client/solo/commands/notice.py b/client/solo/commands/notice.py index a8f21423d..a29f64cf2 100644 --- a/client/solo/commands/notice.py +++ b/client/solo/commands/notice.py @@ -17,8 +17,8 @@ from entropy.output import darkred, blue, brown, darkgreen from entropy.client.interfaces.noticeboard import NoticeBoard -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloNotice(SoloCommand): """ diff --git a/client/solo/commands/pkg.py b/client/solo/commands/pkg.py index 1178a9e6d..faf494351 100644 --- a/client/solo/commands/pkg.py +++ b/client/solo/commands/pkg.py @@ -23,8 +23,8 @@ from entropy.output import darkgreen, teal, brown, purple, darkred, blue import entropy.tools import entropy.dep -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock class SoloPkg(SoloCommand): diff --git a/client/solo/commands/preservedlibs.py b/client/solo/commands/preservedlibs.py index 9a3af6dd8..35a1c9dff 100644 --- a/client/solo/commands/preservedlibs.py +++ b/client/solo/commands/preservedlibs.py @@ -18,10 +18,10 @@ from entropy.output import brown, blue, darkred, darkgreen, purple, teal from entropy.client.interfaces.package import preservedlibs -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock -from solo.utils import enlightenatom +from _entropy.solo.utils import enlightenatom class SoloPreservedLibs(SoloCommand): diff --git a/client/solo/commands/query.py b/client/solo/commands/query.py index e18c28caa..5a371e513 100644 --- a/client/solo/commands/query.py +++ b/client/solo/commands/query.py @@ -22,10 +22,10 @@ from entropy.output import darkgreen, darkred, blue, teal, purple, brown, \ import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock -from solo.utils import print_package_info, print_table, get_file_mime, \ - graph_packages, revgraph_packages +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.utils import print_package_info, print_table, \ + get_file_mime, graph_packages, revgraph_packages class SoloQuery(SoloCommand): @@ -725,7 +725,7 @@ Repository query tools. Solo Query Installed command. Alias of "solo search --installed". """ - from solo.commands.search import SoloSearch + from _entropy.solo.commands.search import SoloSearch search = SoloSearch( self._nsargs, quiet=self._nsargs.quiet, verbose=self._nsargs.verbose, diff --git a/client/solo/commands/remove.py b/client/solo/commands/remove.py index d16373f4d..2127cd90b 100644 --- a/client/solo/commands/remove.py +++ b/client/solo/commands/remove.py @@ -21,9 +21,9 @@ from entropy.exceptions import DependenciesNotRemovable import entropy.tools -from solo.utils import enlightenatom -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands._manage import SoloManage +from _entropy.solo.utils import enlightenatom +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands._manage import SoloManage class SoloRemove(SoloManage): """ diff --git a/client/solo/commands/repo.py b/client/solo/commands/repo.py index 6c2b33af7..9fea55baf 100644 --- a/client/solo/commands/repo.py +++ b/client/solo/commands/repo.py @@ -21,9 +21,9 @@ from entropy.const import etpConst import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand -from solo.utils import print_table +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand +from _entropy.solo.utils import print_table class SoloRepo(SoloCommand): """ diff --git a/client/solo/commands/rescue.py b/client/solo/commands/rescue.py index 6f8b5fe49..93f0f60c5 100644 --- a/client/solo/commands/rescue.py +++ b/client/solo/commands/rescue.py @@ -23,8 +23,9 @@ from entropy.exceptions import SystemDatabaseError from entropy.db.exceptions import OperationalError, DatabaseError from entropy.client.interfaces.db import InstalledPackagesRepository -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock, exclusivelock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock, \ + exclusivelock import entropy.dep import entropy.tools diff --git a/client/solo/commands/search.py b/client/solo/commands/search.py index b675f3369..fd07e6fc0 100644 --- a/client/solo/commands/search.py +++ b/client/solo/commands/search.py @@ -15,9 +15,9 @@ import argparse from entropy.i18n import _, ngettext from entropy.output import darkred, blue, brown, darkgreen, purple -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock -from solo.utils import print_table, print_package_info +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.utils import print_table, print_package_info import entropy.dep diff --git a/client/solo/commands/security.py b/client/solo/commands/security.py index cb01519aa..1310201ac 100644 --- a/client/solo/commands/security.py +++ b/client/solo/commands/security.py @@ -19,9 +19,9 @@ from entropy.output import darkgreen, darkred, brown, blue, red, \ import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.install import SoloInstall -from solo.utils import print_table +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.install import SoloInstall +from _entropy.solo.utils import print_table class SoloSecurity(SoloInstall): diff --git a/client/solo/commands/source.py b/client/solo/commands/source.py index 971aa14d9..f4c1463ea 100644 --- a/client/solo/commands/source.py +++ b/client/solo/commands/source.py @@ -16,8 +16,8 @@ import argparse from entropy.i18n import _ from entropy.output import darkred, darkgreen, blue -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands._manage import SoloManage +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands._manage import SoloManage class SoloSource(SoloManage): """ diff --git a/client/solo/commands/status.py b/client/solo/commands/status.py index 4e63265e4..1572d1fd9 100644 --- a/client/solo/commands/status.py +++ b/client/solo/commands/status.py @@ -19,8 +19,8 @@ from entropy.const import etpConst, const_convert_to_unicode import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloStatus(SoloCommand): """ diff --git a/client/solo/commands/ugc.py b/client/solo/commands/ugc.py index 9539fa94c..17133c08c 100644 --- a/client/solo/commands/ugc.py +++ b/client/solo/commands/ugc.py @@ -24,9 +24,9 @@ from entropy.client.services.interfaces import Document, DocumentFactory, \ import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand -from solo.utils import get_entropy_webservice as _get_service +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand +from _entropy.solo.utils import get_entropy_webservice as _get_service class SoloUgc(SoloCommand): diff --git a/client/solo/commands/unused.py b/client/solo/commands/unused.py index 8968cc47b..fd95a2570 100644 --- a/client/solo/commands/unused.py +++ b/client/solo/commands/unused.py @@ -20,8 +20,8 @@ from entropy.output import red, blue, brown, darkgreen import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand, sharedlock +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand, sharedlock class SoloUnused(SoloCommand): diff --git a/client/solo/commands/update.py b/client/solo/commands/update.py index f0c6fcd18..f6e3ca041 100644 --- a/client/solo/commands/update.py +++ b/client/solo/commands/update.py @@ -22,8 +22,8 @@ from entropy.client.interfaces.noticeboard import NoticeBoard import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloUpdate(SoloCommand): """ diff --git a/client/solo/commands/upgrade.py b/client/solo/commands/upgrade.py index 318623f55..07fd0bfa5 100644 --- a/client/solo/commands/upgrade.py +++ b/client/solo/commands/upgrade.py @@ -20,9 +20,9 @@ from entropy.locks import EntropyResourcesLock import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.install import SoloInstall -from solo.commands.remove import SoloRemove +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.install import SoloInstall +from _entropy.solo.commands.remove import SoloRemove class SoloUpgrade(SoloInstall, SoloRemove): diff --git a/client/solo/commands/version.py b/client/solo/commands/version.py index 5ecd23868..57d081eb1 100644 --- a/client/solo/commands/version.py +++ b/client/solo/commands/version.py @@ -12,10 +12,10 @@ from entropy.i18n import _ from entropy.output import TextInterface -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand -from solo.utils import read_client_release +from _entropy.solo.utils import read_client_release class SoloVersion(SoloCommand): """ diff --git a/client/solo/commands/yell.py b/client/solo/commands/yell.py index 9f3b913e9..7dc6543ab 100644 --- a/client/solo/commands/yell.py +++ b/client/solo/commands/yell.py @@ -15,8 +15,8 @@ from entropy.i18n import _ from entropy.output import TextInterface from entropy.cache import EntropyCacher -from solo.commands.descriptor import SoloCommandDescriptor -from solo.commands.command import SoloCommand +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.commands.command import SoloCommand class SoloYell(SoloCommand): """ diff --git a/client/solo/main.py b/client/solo/main.py index 4939734e4..60c8cedf8 100644 --- a/client/solo/main.py +++ b/client/solo/main.py @@ -25,8 +25,8 @@ from entropy.exceptions import SystemDatabaseError, OnlineMirrorError, \ import entropy.tools -from solo.commands.descriptor import SoloCommandDescriptor -from solo.utils import read_client_release +from _entropy.solo.commands.descriptor import SoloCommandDescriptor +from _entropy.solo.utils import read_client_release def handle_exception(exc_class, exc_instance, exc_tb): diff --git a/entropy_path_loader/compat/_entropy/__init__.py b/entropy_path_loader/compat/_entropy/__init__.py new file mode 100644 index 000000000..7ff8ac835 --- /dev/null +++ b/entropy_path_loader/compat/_entropy/__init__.py @@ -0,0 +1,4 @@ +import sys + +import solo +sys.modules['_entropy.solo'] = solo diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index 60bdaab1f..798ea6f56 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -31,7 +31,8 @@ def add_import_path(mod): mods = ( "client", "server", - "lib" + "lib", + "entropy_path_loader/compat" ) for mod in mods: diff --git a/lib/tests/client.py b/lib/tests/client.py index 5b6efd654..ac195fec9 100644 --- a/lib/tests/client.py +++ b/lib/tests/client.py @@ -308,7 +308,7 @@ else: # this test might be considered controversial, for now, let's keep it # here, we use equo stuff to make sure it keeps working - from solo.commands.pkg import SoloPkg + from _entropy.solo.commands.pkg import SoloPkg # we need to tweak the default unpack dir to make pkg install available # for uids != 0 From 713cf0e927ea46228b5bb07dc4b938f4829d0987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 04/10] usage magneto imports --- .../compat/_entropy/__init__.py | 16 ++++++++++++++ entropy_path_loader/entropy_path_loader.py | 1 + magneto/src/magneto/core/interfaces.py | 2 +- magneto/src/magneto/gtk/interfaces.py | 6 +++--- magneto/src/magneto/gtk3/interfaces.py | 6 +++--- magneto/src/magneto/qt5/interfaces.py | 6 +++--- magneto/src/magneto_app.py | 21 +++++++++---------- 7 files changed, 37 insertions(+), 21 deletions(-) diff --git a/entropy_path_loader/compat/_entropy/__init__.py b/entropy_path_loader/compat/_entropy/__init__.py index 7ff8ac835..90d707d74 100644 --- a/entropy_path_loader/compat/_entropy/__init__.py +++ b/entropy_path_loader/compat/_entropy/__init__.py @@ -1,4 +1,20 @@ +# -*- coding: utf-8 -*- +""" + + @author: Slawomir Nizio + @contact: lxnay@sabayon.org, slawomir.nizio@sabayon.org + @copyright: Slawomir Nizio + @license: GPL-2 + + B{Module to provide _entropy namespace}. + + When installed, internal modules go into B{_entropy}. This provides it for + running from the checkout. +""" import sys import solo sys.modules['_entropy.solo'] = solo + +import magneto +sys.modules['_entropy.magneto'] = magneto diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index 798ea6f56..00a7841b1 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -32,6 +32,7 @@ mods = ( "client", "server", "lib", + "magneto/src", "entropy_path_loader/compat" ) diff --git a/magneto/src/magneto/core/interfaces.py b/magneto/src/magneto/core/interfaces.py index fc12775d4..22a5ed10d 100644 --- a/magneto/src/magneto/core/interfaces.py +++ b/magneto/src/magneto/core/interfaces.py @@ -28,7 +28,7 @@ from entropy.i18n import _, ngettext from entropy.misc import ParallelTask # Magneto imports -from magneto.core import config +from _entropy.magneto.core import config # RigoDaemon imports from RigoDaemon.config import DbusConfig diff --git a/magneto/src/magneto/gtk/interfaces.py b/magneto/src/magneto/gtk/interfaces.py index 28b7b59c9..b3a1ece99 100644 --- a/magneto/src/magneto/gtk/interfaces.py +++ b/magneto/src/magneto/gtk/interfaces.py @@ -20,9 +20,9 @@ import gobject import pynotify # applet imports -from magneto.core import config -from magneto.core.interfaces import MagnetoCore -from magneto.gtk.components import AppletNoticeWindow +from _entropy.magneto.core import config +from _entropy.magneto.core.interfaces import MagnetoCore +from _entropy.magneto.gtk.components import AppletNoticeWindow # Entropy imports from entropy.i18n import _ diff --git a/magneto/src/magneto/gtk3/interfaces.py b/magneto/src/magneto/gtk3/interfaces.py index e07303df7..395c6ce03 100644 --- a/magneto/src/magneto/gtk3/interfaces.py +++ b/magneto/src/magneto/gtk3/interfaces.py @@ -17,9 +17,9 @@ import time import subprocess # applet imports -from magneto.core import config -from magneto.core.interfaces import MagnetoCore -from magneto.gtk3.components import AppletNoticeWindow +from _entropy.magneto.core import config +from _entropy.magneto.core.interfaces import MagnetoCore +from _entropy.magneto.gtk3.components import AppletNoticeWindow # Entropy imports from entropy.i18n import _ diff --git a/magneto/src/magneto/qt5/interfaces.py b/magneto/src/magneto/qt5/interfaces.py index 7998a73ae..9246dbf96 100644 --- a/magneto/src/magneto/qt5/interfaces.py +++ b/magneto/src/magneto/qt5/interfaces.py @@ -19,9 +19,9 @@ from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMenu, \ QAction, QDialog # Magneto imports -from magneto.core import config -from magneto.core.interfaces import MagnetoCore -from magneto.qt5.components import AppletNoticeWindow +from _entropy.magneto.core import config +from _entropy.magneto.core.interfaces import MagnetoCore +from _entropy.magneto.qt5.components import AppletNoticeWindow # Entropy imports from entropy.i18n import _ diff --git a/magneto/src/magneto_app.py b/magneto/src/magneto_app.py index 8b60b6d73..ccbc06fb5 100755 --- a/magneto/src/magneto_app.py +++ b/magneto/src/magneto_app.py @@ -22,7 +22,6 @@ if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) import entropy_path_loader entropy_path_loader.add_import_path("rigo") - entropy_path_loader.add_import_path("magneto") del osp from entropy.locks import SimpleFileLock @@ -47,34 +46,34 @@ def _startup(unlock_callback): is_mate = desktop_session == "MATE" if "--kde" in sys.argv: - from magneto.qt5.interfaces import Magneto + from _entropy.magneto.qt5.interfaces import Magneto elif "--gtk" in sys.argv: - from magneto.gtk.interfaces import Magneto + from _entropy.magneto.gtk.interfaces import Magneto elif "--gtk3" in sys.argv: - from magneto.gtk3.interfaces import Magneto + from _entropy.magneto.gtk3.interfaces import Magneto else: if kde_env is not None: # this is KDE! try: - from magneto.qt5.interfaces import Magneto + from _entropy.magneto.qt5.interfaces import Magneto except (ImportError, RuntimeError,): # try GTK3, then GTK try: - from magneto.gtk3.interfaces import Magneto + from _entropy.magneto.gtk3.interfaces import Magneto except ImportError: - from magneto.gtk.interfaces import Magneto + from _entropy.magneto.gtk.interfaces import Magneto elif is_mate: # Load GTK2, fallback to GTK3 try: - from magneto.gtk.interfaces import Magneto + from _entropy.magneto.gtk.interfaces import Magneto except ImportError: - from magneto.gtk3.interfaces import Magneto + from _entropy.magneto.gtk3.interfaces import Magneto else: # load GTK3, fallback to GTK2 try: - from magneto.gtk3.interfaces import Magneto + from _entropy.magneto.gtk3.interfaces import Magneto except ImportError: - from magneto.gtk.interfaces import Magneto + from _entropy.magneto.gtk.interfaces import Magneto import entropy.tools magneto = Magneto() From 321d59614f20d119972a50fbc2368ad522aa3d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 05/10] update eit imports + minor rename in entropy_path_loader --- entropy_path_loader/compat/_entropy/__init__.py | 3 +++ entropy_path_loader/entropy_path_loader.py | 10 +++++----- server/doc/generate | 2 +- server/eit.py | 2 +- server/eit/commands/__init__.py | 2 +- server/eit/commands/add.py | 4 ++-- server/eit/commands/branch.py | 4 ++-- server/eit/commands/bump.py | 4 ++-- server/eit/commands/checkout.py | 4 ++-- server/eit/commands/cleanup.py | 4 ++-- server/eit/commands/commit.py | 4 ++-- server/eit/commands/cp.py | 4 ++-- server/eit/commands/deps.py | 4 ++-- server/eit/commands/files.py | 4 ++-- server/eit/commands/graph.py | 6 +++--- server/eit/commands/help.py | 6 +++--- server/eit/commands/init.py | 4 ++-- server/eit/commands/inject.py | 4 ++-- server/eit/commands/key.py | 4 ++-- server/eit/commands/list.py | 4 ++-- server/eit/commands/lock.py | 4 ++-- server/eit/commands/log.py | 4 ++-- server/eit/commands/match.py | 6 +++--- server/eit/commands/merge.py | 4 ++-- server/eit/commands/mv.py | 4 ++-- server/eit/commands/notice.py | 4 ++-- server/eit/commands/own.py | 6 +++--- server/eit/commands/pkgmove.py | 4 ++-- server/eit/commands/pull.py | 6 +++--- server/eit/commands/push.py | 4 ++-- server/eit/commands/query.py | 6 +++--- server/eit/commands/remote.py | 4 ++-- server/eit/commands/remove.py | 4 ++-- server/eit/commands/repack.py | 4 ++-- server/eit/commands/repo.py | 6 +++--- server/eit/commands/reset.py | 4 ++-- server/eit/commands/revgraph.py | 6 +++--- server/eit/commands/search.py | 6 +++--- server/eit/commands/status.py | 6 +++--- server/eit/commands/test.py | 4 ++-- server/eit/main.py | 2 +- 41 files changed, 92 insertions(+), 89 deletions(-) diff --git a/entropy_path_loader/compat/_entropy/__init__.py b/entropy_path_loader/compat/_entropy/__init__.py index 90d707d74..fccf1327e 100644 --- a/entropy_path_loader/compat/_entropy/__init__.py +++ b/entropy_path_loader/compat/_entropy/__init__.py @@ -18,3 +18,6 @@ sys.modules['_entropy.solo'] = solo import magneto sys.modules['_entropy.magneto'] = magneto + +import eit +sys.modules['_entropy.eit'] = eit diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index 00a7841b1..e9a6659b7 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -20,15 +20,15 @@ base_dir = osp.dirname(osp.dirname(osp.realpath(__file__))) in_checkout = osp.isfile(osp.join(base_dir, "entropy-in-vcs-checkout")) -def add_import_path(mod): +def add_import_path(path): if not in_checkout: raise RuntimeError( "entropy_path_loader used when not in checkout") - lib = osp.join(base_dir, mod) + lib = osp.join(base_dir, path) sys.path.insert(0, lib) -mods = ( +mod_paths = ( "client", "server", "lib", @@ -36,5 +36,5 @@ mods = ( "entropy_path_loader/compat" ) -for mod in mods: - add_import_path(mod) +for path in mod_paths: + add_import_path(path) diff --git a/server/doc/generate b/server/doc/generate index b2c87cd10..81d883cba 100755 --- a/server/doc/generate +++ b/server/doc/generate @@ -13,7 +13,7 @@ if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): import entropy_path_loader del osp -from eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.descriptor import EitCommandDescriptor MAN_HEADER="""\ EIT(1) diff --git a/server/eit.py b/server/eit.py index 6324ffea4..907a10685 100755 --- a/server/eit.py +++ b/server/eit.py @@ -11,6 +11,6 @@ if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): import entropy_path_loader del osp -from eit.main import main +from _entropy.eit.main import main sys.argv[0] = "eit" main() diff --git a/server/eit/commands/__init__.py b/server/eit/commands/__init__.py index 7dd9bdfa1..4cb0f3aa2 100644 --- a/server/eit/commands/__init__.py +++ b/server/eit/commands/__init__.py @@ -21,7 +21,7 @@ for py_file in os.listdir(_cur_dir): if py_file.startswith("_"): continue # strip .py - _mod = "eit.commands." + py_file[:-3] + _mod = "_entropy.eit.commands." + py_file[:-3] if _mod in _excluded_mods: continue try: diff --git a/server/eit/commands/add.py b/server/eit/commands/add.py index 9929705ee..9061b82a2 100644 --- a/server/eit/commands/add.py +++ b/server/eit/commands/add.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.commit import EitCommit +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.commit import EitCommit class EitAdd(EitCommit): diff --git a/server/eit/commands/branch.py b/server/eit/commands/branch.py index 0e8e35d90..e39a96cfe 100644 --- a/server/eit/commands/branch.py +++ b/server/eit/commands/branch.py @@ -18,8 +18,8 @@ from entropy.output import bold, purple, darkgreen, blue, teal import entropy.tools -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitBranch(EitCommand): diff --git a/server/eit/commands/bump.py b/server/eit/commands/bump.py index 1fc1c6fc2..2d503527f 100644 --- a/server/eit/commands/bump.py +++ b/server/eit/commands/bump.py @@ -15,8 +15,8 @@ import argparse from entropy.output import darkgreen, blue from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitBump(EitCommand): diff --git a/server/eit/commands/checkout.py b/server/eit/commands/checkout.py index 5d341ada2..59dfb3c46 100644 --- a/server/eit/commands/checkout.py +++ b/server/eit/commands/checkout.py @@ -16,8 +16,8 @@ import argparse from entropy.output import darkgreen, blue from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitCheckout(EitCommand): diff --git a/server/eit/commands/cleanup.py b/server/eit/commands/cleanup.py index adf041aa4..8b7823764 100644 --- a/server/eit/commands/cleanup.py +++ b/server/eit/commands/cleanup.py @@ -16,8 +16,8 @@ import argparse from entropy.output import darkgreen, blue, purple from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitCleanup(EitCommand): diff --git a/server/eit/commands/commit.py b/server/eit/commands/commit.py index e3bb64a79..6cf84513a 100644 --- a/server/eit/commands/commit.py +++ b/server/eit/commands/commit.py @@ -20,8 +20,8 @@ from entropy.output import darkgreen, teal, brown, \ import entropy.tools -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitCommit(EitCommand): diff --git a/server/eit/commands/cp.py b/server/eit/commands/cp.py index bad14fe00..704e94248 100644 --- a/server/eit/commands/cp.py +++ b/server/eit/commands/cp.py @@ -16,8 +16,8 @@ import argparse from entropy.output import darkgreen, blue, brown, bold, red, purple, teal from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitCp(EitCommand): diff --git a/server/eit/commands/deps.py b/server/eit/commands/deps.py index 8cd41ee99..0511154c1 100644 --- a/server/eit/commands/deps.py +++ b/server/eit/commands/deps.py @@ -16,8 +16,8 @@ from entropy.i18n import _ from entropy.const import etpConst from entropy.output import purple, darkgreen, brown, teal, blue -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitDeps(EitCommand): diff --git a/server/eit/commands/files.py b/server/eit/commands/files.py index 12b3dd2e5..b23f2a59e 100644 --- a/server/eit/commands/files.py +++ b/server/eit/commands/files.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ from entropy.output import bold, purple, darkgreen, blue, brown, teal -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitFiles(EitCommand): diff --git a/server/eit/commands/graph.py b/server/eit/commands/graph.py index 02018da66..881783573 100644 --- a/server/eit/commands/graph.py +++ b/server/eit/commands/graph.py @@ -14,9 +14,9 @@ import argparse from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import graph_packages +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import graph_packages class EitGraph(EitCommand): """ diff --git a/server/eit/commands/help.py b/server/eit/commands/help.py index 46fe5ca1f..95cb899ce 100644 --- a/server/eit/commands/help.py +++ b/server/eit/commands/help.py @@ -14,9 +14,9 @@ import argparse from entropy.i18n import _ from entropy.output import teal, purple, darkgreen -from eit.colorful import ColorfulFormatter -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.colorful import ColorfulFormatter +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitHelp(EitCommand): """ diff --git a/server/eit/commands/init.py b/server/eit/commands/init.py index a3c6a7dc6..58317e65b 100644 --- a/server/eit/commands/init.py +++ b/server/eit/commands/init.py @@ -16,8 +16,8 @@ import argparse from entropy.i18n import _ from entropy.output import darkgreen, teal -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitInit(EitCommand): diff --git a/server/eit/commands/inject.py b/server/eit/commands/inject.py index dc53d57ae..a68761b64 100644 --- a/server/eit/commands/inject.py +++ b/server/eit/commands/inject.py @@ -17,8 +17,8 @@ from entropy.const import const_file_readable from entropy.i18n import _ from entropy.output import teal, purple -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitInject(EitCommand): diff --git a/server/eit/commands/key.py b/server/eit/commands/key.py index c53e805fb..d8a896a1f 100644 --- a/server/eit/commands/key.py +++ b/server/eit/commands/key.py @@ -19,8 +19,8 @@ from entropy.i18n import _ from entropy.security import Repository from entropy.tools import convert_unix_time_to_human_time -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitKey(EitCommand): diff --git a/server/eit/commands/list.py b/server/eit/commands/list.py index 465c14baf..5e55835ba 100644 --- a/server/eit/commands/list.py +++ b/server/eit/commands/list.py @@ -17,8 +17,8 @@ from entropy.output import brown, teal, purple, darkgreen import entropy.dep -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitList(EitCommand): diff --git a/server/eit/commands/lock.py b/server/eit/commands/lock.py index 8df1b4e7a..7c8bee676 100644 --- a/server/eit/commands/lock.py +++ b/server/eit/commands/lock.py @@ -16,8 +16,8 @@ from entropy.i18n import _ from entropy.output import darkgreen, brown, purple, blue, darkred from entropy.transceivers import EntropyTransceiver -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitLock(EitCommand): diff --git a/server/eit/commands/log.py b/server/eit/commands/log.py index 5d2791cb5..fd73641de 100644 --- a/server/eit/commands/log.py +++ b/server/eit/commands/log.py @@ -17,8 +17,8 @@ import argparse from entropy.const import const_file_readable from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitLog(EitCommand): diff --git a/server/eit/commands/match.py b/server/eit/commands/match.py index f8ea7a1bb..137dbc5cd 100644 --- a/server/eit/commands/match.py +++ b/server/eit/commands/match.py @@ -15,9 +15,9 @@ import argparse from entropy.i18n import _ from entropy.output import purple -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import print_package_info +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import print_package_info class EitMatch(EitCommand): diff --git a/server/eit/commands/merge.py b/server/eit/commands/merge.py index 6f7df6c6a..81eccec5d 100644 --- a/server/eit/commands/merge.py +++ b/server/eit/commands/merge.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitMerge(EitCommand): diff --git a/server/eit/commands/mv.py b/server/eit/commands/mv.py index 25b1c3db2..0a40b6c10 100644 --- a/server/eit/commands/mv.py +++ b/server/eit/commands/mv.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.cp import EitCp +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.cp import EitCp class EitMv(EitCp): diff --git a/server/eit/commands/notice.py b/server/eit/commands/notice.py index 274e99fe2..5b22351f5 100644 --- a/server/eit/commands/notice.py +++ b/server/eit/commands/notice.py @@ -19,8 +19,8 @@ from entropy.i18n import _ from entropy.output import blue, darkred, darkgreen, purple, brown, teal from entropy.const import const_mkstemp -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitNotice(EitCommand): diff --git a/server/eit/commands/own.py b/server/eit/commands/own.py index b59d6fda2..32ab2ab18 100644 --- a/server/eit/commands/own.py +++ b/server/eit/commands/own.py @@ -16,9 +16,9 @@ import argparse from entropy.i18n import _ from entropy.output import purple, darkgreen, teal, bold -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import print_package_info +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import print_package_info class EitOwn(EitCommand): diff --git a/server/eit/commands/pkgmove.py b/server/eit/commands/pkgmove.py index 8ba442de8..325a5b973 100644 --- a/server/eit/commands/pkgmove.py +++ b/server/eit/commands/pkgmove.py @@ -19,8 +19,8 @@ from entropy.i18n import _ from entropy.output import purple, teal from entropy.const import const_mkstemp -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitPkgmove(EitCommand): diff --git a/server/eit/commands/pull.py b/server/eit/commands/pull.py index 416660fcb..1c612c603 100644 --- a/server/eit/commands/pull.py +++ b/server/eit/commands/pull.py @@ -27,9 +27,9 @@ from entropy.client.interfaces.db import InstalledPackagesRepository import entropy.tools -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.commands.push import EitPush +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.commands.push import EitPush class EitPull(EitCommand): diff --git a/server/eit/commands/push.py b/server/eit/commands/push.py index 404163627..d56badccf 100644 --- a/server/eit/commands/push.py +++ b/server/eit/commands/push.py @@ -27,8 +27,8 @@ from entropy.client.interfaces.db import InstalledPackagesRepository import entropy.tools -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitPush(EitCommand): diff --git a/server/eit/commands/query.py b/server/eit/commands/query.py index 2843f717d..1b70682a5 100644 --- a/server/eit/commands/query.py +++ b/server/eit/commands/query.py @@ -16,9 +16,9 @@ from entropy.output import purple, darkgreen, bold, brown, teal from entropy.const import etpConst from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import print_package_info +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import print_package_info class EitQuery(EitCommand): """ diff --git a/server/eit/commands/remote.py b/server/eit/commands/remote.py index a073852f5..65a3514bc 100644 --- a/server/eit/commands/remote.py +++ b/server/eit/commands/remote.py @@ -22,8 +22,8 @@ from entropy.server.interfaces.main import ServerSystemSettingsPlugin import entropy.tools -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitRemote(EitCommand): """ diff --git a/server/eit/commands/remove.py b/server/eit/commands/remove.py index d0eb6d3ed..dbebd4567 100644 --- a/server/eit/commands/remove.py +++ b/server/eit/commands/remove.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ from entropy.output import purple, darkgreen, brown, teal -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitRemove(EitCommand): diff --git a/server/eit/commands/repack.py b/server/eit/commands/repack.py index 8173b984e..fcc75adfb 100644 --- a/server/eit/commands/repack.py +++ b/server/eit/commands/repack.py @@ -14,8 +14,8 @@ import argparse from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.commit import EitCommit +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.commit import EitCommit class EitRepack(EitCommit): diff --git a/server/eit/commands/repo.py b/server/eit/commands/repo.py index c5d42cb27..15428b7ef 100644 --- a/server/eit/commands/repo.py +++ b/server/eit/commands/repo.py @@ -16,9 +16,9 @@ from entropy.i18n import _ from entropy.output import blue, darkgreen, purple, teal from entropy.server.interfaces import RepositoryConfigParser -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import print_table +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import print_table class EitRepo(EitCommand): diff --git a/server/eit/commands/reset.py b/server/eit/commands/reset.py index e4ba1712e..0acc77f69 100644 --- a/server/eit/commands/reset.py +++ b/server/eit/commands/reset.py @@ -15,8 +15,8 @@ import argparse from entropy.i18n import _ from entropy.output import darkgreen -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.pull import EitPull +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.pull import EitPull class EitReset(EitPull): diff --git a/server/eit/commands/revgraph.py b/server/eit/commands/revgraph.py index b82c5cd6e..33ad1e56f 100644 --- a/server/eit/commands/revgraph.py +++ b/server/eit/commands/revgraph.py @@ -14,9 +14,9 @@ import argparse from entropy.i18n import _ -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import revgraph_packages +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import revgraph_packages class EitRevgraph(EitCommand): diff --git a/server/eit/commands/search.py b/server/eit/commands/search.py index 0e2130633..5a9a8b8b7 100644 --- a/server/eit/commands/search.py +++ b/server/eit/commands/search.py @@ -15,9 +15,9 @@ import argparse from entropy.i18n import _ from entropy.output import purple -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import print_package_info +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import print_package_info class EitSearch(EitCommand): diff --git a/server/eit/commands/status.py b/server/eit/commands/status.py index c31837dd6..ecb9be077 100644 --- a/server/eit/commands/status.py +++ b/server/eit/commands/status.py @@ -18,9 +18,9 @@ from entropy.i18n import _ from entropy.output import darkgreen, teal, brown, darkred, \ bold, purple, blue -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand -from eit.utils import print_table +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand +from _entropy.eit.utils import print_table class EitStatus(EitCommand): diff --git a/server/eit/commands/test.py b/server/eit/commands/test.py index d4c6b6a90..0cede7668 100644 --- a/server/eit/commands/test.py +++ b/server/eit/commands/test.py @@ -16,8 +16,8 @@ from entropy.i18n import _ from entropy.output import teal, purple from entropy.server.interfaces import Server -from eit.commands.descriptor import EitCommandDescriptor -from eit.commands.command import EitCommand +from _entropy.eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.command import EitCommand class EitTest(EitCommand): diff --git a/server/eit/main.py b/server/eit/main.py index f7268901b..600737c28 100644 --- a/server/eit/main.py +++ b/server/eit/main.py @@ -19,7 +19,7 @@ from entropy.output import print_error import entropy.tools from entropy.exceptions import OnlineMirrorError -from eit.commands.descriptor import EitCommandDescriptor +from _entropy.eit.commands.descriptor import EitCommandDescriptor def handle_exception(exc_class, exc_instance, exc_tb): From 3e74fa847c62cd7372f55bec2aef1a0f2edb4e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 06/10] update matter imports --- entropy_path_loader/compat/_entropy/__init__.py | 3 +++ entropy_path_loader/entropy_path_loader.py | 1 + matter/matter/binpms/base.py | 2 +- matter/matter/binpms/entropysrv.py | 9 +++++---- matter/matter/builder.py | 4 ++-- matter/matter/main.py | 17 ++++++++--------- matter/matter/output.py | 2 +- matter/matter/spec.py | 2 +- matter/matter_app.py | 3 +-- 9 files changed, 23 insertions(+), 20 deletions(-) diff --git a/entropy_path_loader/compat/_entropy/__init__.py b/entropy_path_loader/compat/_entropy/__init__.py index fccf1327e..179a15209 100644 --- a/entropy_path_loader/compat/_entropy/__init__.py +++ b/entropy_path_loader/compat/_entropy/__init__.py @@ -21,3 +21,6 @@ sys.modules['_entropy.magneto'] = magneto import eit sys.modules['_entropy.eit'] = eit + +import matter +sys.modules['_entropy.matter'] = matter diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index e9a6659b7..429087376 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -33,6 +33,7 @@ mod_paths = ( "server", "lib", "magneto/src", + "matter", "entropy_path_loader/compat" ) diff --git a/matter/matter/binpms/base.py b/matter/matter/binpms/base.py index b8993249e..5e0444d8d 100644 --- a/matter/matter/binpms/base.py +++ b/matter/matter/binpms/base.py @@ -17,7 +17,7 @@ import os import shutil import subprocess -from matter.output import print_info, print_warning +from _entropy.matter.output import print_info, print_warning class BaseBinaryResourceLock(object): diff --git a/matter/matter/binpms/entropysrv.py b/matter/matter/binpms/entropysrv.py index 5680436b9..847f9001c 100644 --- a/matter/matter/binpms/entropysrv.py +++ b/matter/matter/binpms/entropysrv.py @@ -17,11 +17,12 @@ import subprocess import sys import threading -from matter.binpms.base import BaseBinaryResourceLock, \ +from _entropy.matter.binpms.base import BaseBinaryResourceLock, \ BaseBinaryPMS -from matter.spec import MatterSpec, MatterSpecParser, GenericSpecFunctions -from matter.output import print_info, print_warning, print_error -from matter.utils import print_traceback +from _entropy.matter.spec import MatterSpec, MatterSpecParser, \ + GenericSpecFunctions +from _entropy.matter.output import print_info, print_warning, print_error +from _entropy.matter.utils import print_traceback os.environ["ETP_GETTEXT_DOMAIN"] = "entropy-server" diff --git a/matter/matter/builder.py b/matter/matter/builder.py index 926fc3a7c..cf423879a 100644 --- a/matter/matter/builder.py +++ b/matter/matter/builder.py @@ -19,8 +19,8 @@ import shutil import subprocess import tempfile -from matter.utils import mkstemp, mkdtemp, print_traceback -from matter.output import is_stdout_a_tty, print_info, print_warning, \ +from _entropy.matter.utils import mkstemp, mkdtemp, print_traceback +from _entropy.matter.output import is_stdout_a_tty, print_info, print_warning, \ print_error, getcolor, darkgreen, purple, brown # default mandatory features diff --git a/matter/matter/main.py b/matter/matter/main.py index 900620848..80ef1656b 100644 --- a/matter/matter/main.py +++ b/matter/matter/main.py @@ -17,14 +17,13 @@ import argparse import collections # keep these before PackageBuilder due to the os.environ stuff inside -from matter.binpms.base import BaseBinaryPMS, BaseBinaryResourceLock -from matter.builder import PackageBuilder -from matter.lock import MatterResourceLock -from matter.output import purple, darkgreen, print_info, \ +from _entropy.matter.binpms.base import BaseBinaryPMS, BaseBinaryResourceLock +from _entropy.matter.builder import PackageBuilder +from _entropy.matter.lock import MatterResourceLock +from _entropy.matter.output import purple, darkgreen, print_info, \ print_generic, print_warning, print_error, is_stdout_a_tty, nocolor -from matter.spec import SpecParser, MatterSpec -from matter.utils import print_exception - +from _entropy.matter.spec import SpecParser, MatterSpec +from _entropy.matter.utils import print_exception def install_exception_handler(): sys.excepthook = handle_exception @@ -260,7 +259,7 @@ def main(): nocolor() # Load Binary PMS modules - import matter.binpms as _pms + import _entropy.matter.binpms as _pms pms_dir = os.path.dirname(_pms.__file__) for thing in os.listdir(pms_dir): if thing.startswith("__init__.py"): @@ -274,7 +273,7 @@ def main(): name = os.path.basename(thing) name = name.rstrip(".py") - package = "matter.binpms.%s" % (name,) + package = "_entropy.matter.binpms.%s" % (name,) try: importlib.import_module(package) # they will then register diff --git a/matter/matter/output.py b/matter/matter/output.py index 8482430d7..06f3c9f6e 100644 --- a/matter/matter/output.py +++ b/matter/matter/output.py @@ -17,7 +17,7 @@ import errno import os import sys -from matter.utils import is_python3 +from _entropy.matter.utils import is_python3 stuff = {} diff --git a/matter/matter/spec.py b/matter/matter/spec.py index 4c85ca2fc..5d22219e3 100644 --- a/matter/matter/spec.py +++ b/matter/matter/spec.py @@ -12,7 +12,7 @@ import os import shlex -from matter.utils import convert_to_unicode, get_stringtype +from _entropy.matter.utils import convert_to_unicode, get_stringtype class GenericSpecFunctions(object): diff --git a/matter/matter_app.py b/matter/matter_app.py index a6cd67e30..4b709e3c5 100755 --- a/matter/matter_app.py +++ b/matter/matter_app.py @@ -18,10 +18,9 @@ _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) import entropy_path_loader - entropy_path_loader.add_import_path("matter") del osp -from matter.main import main +from _entropy.matter.main import main if __name__ == "__main__": sys.argv[0] = "matter" From 503e7077f30c58bac7e42db3b03edeb092e21043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 07/10] update rigo imports --- .../compat/_entropy/__init__.py | 3 + entropy_path_loader/entropy_path_loader.py | 1 + magneto/src/magneto_app.py | 1 - rigo/RigoDaemon/app/RigoDaemon_app.py | 1 - rigo/rigo/controllers/daemon.py | 12 ++-- rigo/rigo/entropyapi.py | 2 +- rigo/rigo/models/application.py | 4 +- rigo/rigo/models/configupdate.py | 4 +- rigo/rigo/models/group.py | 2 +- rigo/rigo/models/noticeboard.py | 2 +- rigo/rigo/models/preference.py | 2 +- rigo/rigo/models/repository.py | 2 +- rigo/rigo/ui/gtk3/controllers/application.py | 16 ++--- rigo/rigo/ui/gtk3/controllers/applications.py | 12 ++-- rigo/rigo/ui/gtk3/controllers/confupdate.py | 4 +- rigo/rigo/ui/gtk3/controllers/group.py | 8 +-- rigo/rigo/ui/gtk3/controllers/noticeboard.py | 8 +-- .../rigo/ui/gtk3/controllers/notifications.py | 4 +- rigo/rigo/ui/gtk3/controllers/repository.py | 10 +-- rigo/rigo/ui/gtk3/controllers/work.py | 8 +-- rigo/rigo/ui/gtk3/models/appliststore.py | 4 +- rigo/rigo/ui/gtk3/utils.py | 2 +- rigo/rigo/ui/gtk3/widgets/apptreeview.py | 8 +-- rigo/rigo/ui/gtk3/widgets/cellrenderers.py | 6 +- rigo/rigo/ui/gtk3/widgets/comments.py | 4 +- .../ui/gtk3/widgets/confupdatetreeview.py | 7 +- rigo/rigo/ui/gtk3/widgets/generictreeview.py | 2 +- rigo/rigo/ui/gtk3/widgets/grouptreeview.py | 4 +- rigo/rigo/ui/gtk3/widgets/images.py | 12 ++-- .../ui/gtk3/widgets/noticeboardtreeview.py | 7 +- rigo/rigo/ui/gtk3/widgets/notifications.py | 8 +-- .../ui/gtk3/widgets/preferencestreeview.py | 5 +- .../ui/gtk3/widgets/repositorytreeview.py | 4 +- rigo/rigo/ui/gtk3/widgets/stars.py | 4 +- rigo/rigo/ui/gtk3/widgets/terminal.py | 4 +- rigo/rigo/ui/gtk3/widgets/welcome.py | 2 +- rigo/rigo_app.py | 67 ++++++++++--------- 37 files changed, 134 insertions(+), 122 deletions(-) diff --git a/entropy_path_loader/compat/_entropy/__init__.py b/entropy_path_loader/compat/_entropy/__init__.py index 179a15209..68de2416e 100644 --- a/entropy_path_loader/compat/_entropy/__init__.py +++ b/entropy_path_loader/compat/_entropy/__init__.py @@ -24,3 +24,6 @@ sys.modules['_entropy.eit'] = eit import matter sys.modules['_entropy.matter'] = matter + +import rigo +sys.modules['_entropy.rigo'] = rigo diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index 429087376..f1794f187 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -34,6 +34,7 @@ mod_paths = ( "lib", "magneto/src", "matter", + "rigo", "entropy_path_loader/compat" ) diff --git a/magneto/src/magneto_app.py b/magneto/src/magneto_app.py index ccbc06fb5..12efe062c 100755 --- a/magneto/src/magneto_app.py +++ b/magneto/src/magneto_app.py @@ -21,7 +21,6 @@ _base = osp.dirname( if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) import entropy_path_loader - entropy_path_loader.add_import_path("rigo") del osp from entropy.locks import SimpleFileLock diff --git a/rigo/RigoDaemon/app/RigoDaemon_app.py b/rigo/RigoDaemon/app/RigoDaemon_app.py index 4b2401777..be402e765 100755 --- a/rigo/RigoDaemon/app/RigoDaemon_app.py +++ b/rigo/RigoDaemon/app/RigoDaemon_app.py @@ -58,7 +58,6 @@ _base = osp.dirname(osp.dirname( if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) import entropy_path_loader - entropy_path_loader.add_import_path("rigo") del osp from entropy.cache import EntropyCacher diff --git a/rigo/rigo/controllers/daemon.py b/rigo/rigo/controllers/daemon.py index 93720c5a1..aa6bec120 100644 --- a/rigo/rigo/controllers/daemon.py +++ b/rigo/rigo/controllers/daemon.py @@ -28,19 +28,19 @@ import dbus from gi.repository import Gtk, GLib, GObject -from rigo.enums import AppActions, RigoViewStates, \ +from _entropy.rigo.enums import AppActions, RigoViewStates, \ LocalActivityStates -from rigo.models.application import Application -from rigo.models.configupdate import ConfigUpdate -from rigo.models.noticeboard import Notice -from rigo.ui.gtk3.widgets.notifications import NotificationBox, \ +from _entropy.rigo.models.application import Application +from _entropy.rigo.models.configupdate import ConfigUpdate +from _entropy.rigo.models.noticeboard import Notice +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox, \ PleaseWaitNotificationBox, LicensesNotificationBox, \ OrphanedAppsNotificationBox, InstallNotificationBox, \ RemovalNotificationBox, QueueActionNotificationBox, \ UpdatesNotificationBox, RepositoriesUpdateNotificationBox, \ PreservedLibsNotificationBox -from rigo.utils import prepare_markup +from _entropy.rigo.utils import prepare_markup from RigoDaemon.enums import ActivityStates as DaemonActivityStates, \ AppActions as DaemonAppActions, \ diff --git a/rigo/rigo/entropyapi.py b/rigo/rigo/entropyapi.py index fec001e81..cb9d9bdf2 100644 --- a/rigo/rigo/entropyapi.py +++ b/rigo/rigo/entropyapi.py @@ -22,7 +22,7 @@ import os import tempfile from threading import Lock -from rigo.paths import CONF_DIR +from _entropy.rigo.paths import CONF_DIR from entropy.misc import ReadersWritersSemaphore from entropy.services.client import WebService diff --git a/rigo/rigo/models/application.py b/rigo/rigo/models/application.py index 0d629bf44..1b61bab5b 100644 --- a/rigo/rigo/models/application.py +++ b/rigo/rigo/models/application.py @@ -41,8 +41,8 @@ from entropy.client.services.interfaces import ClientWebService, \ import entropy.tools import entropy.dep -from rigo.enums import Icons -from rigo.utils import build_application_store_url, escape_markup, \ +from _entropy.rigo.enums import Icons +from _entropy.rigo.utils import build_application_store_url, escape_markup, \ prepare_markup diff --git a/rigo/rigo/models/configupdate.py b/rigo/rigo/models/configupdate.py index 22fb51e15..3989800c9 100644 --- a/rigo/rigo/models/configupdate.py +++ b/rigo/rigo/models/configupdate.py @@ -25,8 +25,8 @@ from threading import Semaphore from gi.repository import Gtk, GLib -from rigo.utils import escape_markup, prepare_markup, open_editor -from rigo.ui.gtk3.widgets.notifications import NotificationBox +from _entropy.rigo.utils import escape_markup, prepare_markup, open_editor +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox from entropy.const import const_file_writable from entropy.i18n import _ diff --git a/rigo/rigo/models/group.py b/rigo/rigo/models/group.py index cfd4fe2e8..e860ee846 100644 --- a/rigo/rigo/models/group.py +++ b/rigo/rigo/models/group.py @@ -19,7 +19,7 @@ this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA """ -from rigo.utils import prepare_markup, escape_markup +from _entropy.rigo.utils import prepare_markup, escape_markup class Group(object): diff --git a/rigo/rigo/models/noticeboard.py b/rigo/rigo/models/noticeboard.py index 25a3eda51..db43817b1 100644 --- a/rigo/rigo/models/noticeboard.py +++ b/rigo/rigo/models/noticeboard.py @@ -21,7 +21,7 @@ this program; if not, write to the Free Software Foundation, Inc., import hashlib import email.utils -from rigo.utils import prepare_markup, escape_markup +from _entropy.rigo.utils import prepare_markup, escape_markup class Notice(object): diff --git a/rigo/rigo/models/preference.py b/rigo/rigo/models/preference.py index 37085f9fe..bb29adeda 100644 --- a/rigo/rigo/models/preference.py +++ b/rigo/rigo/models/preference.py @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA """ -from rigo.utils import prepare_markup +from _entropy.rigo.utils import prepare_markup class Preference(object): diff --git a/rigo/rigo/models/repository.py b/rigo/rigo/models/repository.py index 00e7bb7c8..b50a536eb 100644 --- a/rigo/rigo/models/repository.py +++ b/rigo/rigo/models/repository.py @@ -21,7 +21,7 @@ this program; if not, write to the Free Software Foundation, Inc., import hashlib import email.utils -from rigo.utils import prepare_markup, escape_markup +from _entropy.rigo.utils import prepare_markup, escape_markup from entropy.i18n import _ diff --git a/rigo/rigo/ui/gtk3/controllers/application.py b/rigo/rigo/ui/gtk3/controllers/application.py index 317fc82e6..f2916b2b6 100644 --- a/rigo/rigo/ui/gtk3/controllers/application.py +++ b/rigo/rigo/ui/gtk3/controllers/application.py @@ -21,16 +21,16 @@ this program; if not, write to the Free Software Foundation, Inc., from gi.repository import Gtk, Gdk, GLib, GObject -from rigo.em import StockEms -from rigo.enums import AppActions, RigoViewStates -from rigo.ui.gtk3.widgets.notifications import NotificationBox, \ +from _entropy.rigo.em import StockEms +from _entropy.rigo.enums import AppActions, RigoViewStates +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox, \ LoginNotificationBox -from rigo.ui.gtk3.widgets.stars import ReactiveStar -from rigo.ui.gtk3.widgets.comments import CommentBox -from rigo.ui.gtk3.widgets.images import ImageBox -from rigo.utils import build_application_store_url, \ +from _entropy.rigo.ui.gtk3.widgets.stars import ReactiveStar +from _entropy.rigo.ui.gtk3.widgets.comments import CommentBox +from _entropy.rigo.ui.gtk3.widgets.images import ImageBox +from _entropy.rigo.utils import build_application_store_url, \ escape_markup, prepare_markup -from rigo.models.preference import Preference +from _entropy.rigo.models.preference import Preference from RigoDaemon.enums import AppActions as DaemonAppActions, \ ActivityStates as DaemonActivityStates diff --git a/rigo/rigo/ui/gtk3/controllers/applications.py b/rigo/rigo/ui/gtk3/controllers/applications.py index 174dc4e26..86ca5f750 100644 --- a/rigo/rigo/ui/gtk3/controllers/applications.py +++ b/rigo/rigo/ui/gtk3/controllers/applications.py @@ -26,12 +26,12 @@ from threading import Lock, Semaphore, Timer from gi.repository import Gtk, GLib, GObject -from rigo.paths import CONF_DIR -from rigo.enums import RigoViewStates, AppActions, Icons -from rigo.models.application import Application, ApplicationMetadata -from rigo.models.preference import Preference -from rigo.utils import escape_markup, prepare_markup -from rigo.ui.gtk3.widgets.notifications import \ +from _entropy.rigo.paths import CONF_DIR +from _entropy.rigo.enums import RigoViewStates, AppActions, Icons +from _entropy.rigo.models.application import Application, ApplicationMetadata +from _entropy.rigo.models.preference import Preference +from _entropy.rigo.utils import escape_markup, prepare_markup +from _entropy.rigo.ui.gtk3.widgets.notifications import \ NotificationBox from entropy.cache import EntropyCacher diff --git a/rigo/rigo/ui/gtk3/controllers/confupdate.py b/rigo/rigo/ui/gtk3/controllers/confupdate.py index 280d1506a..fc4dc3c3f 100644 --- a/rigo/rigo/ui/gtk3/controllers/confupdate.py +++ b/rigo/rigo/ui/gtk3/controllers/confupdate.py @@ -22,9 +22,9 @@ from gi.repository import GObject, Gtk, GLib from threading import Lock -from rigo.ui.gtk3.widgets.notifications import \ +from _entropy.rigo.ui.gtk3.widgets.notifications import \ ConfigUpdatesNotificationBox, NotificationBox -from rigo.utils import prepare_markup +from _entropy.rigo.utils import prepare_markup from entropy.i18n import _ from entropy.const import const_debug_write diff --git a/rigo/rigo/ui/gtk3/controllers/group.py b/rigo/rigo/ui/gtk3/controllers/group.py index 7c1016012..dcb48025e 100644 --- a/rigo/rigo/ui/gtk3/controllers/group.py +++ b/rigo/rigo/ui/gtk3/controllers/group.py @@ -24,10 +24,10 @@ import errno from gi.repository import Gtk, GObject, GLib -from rigo.enums import Icons, RigoViewStates -from rigo.utils import prepare_markup -from rigo.models.preference import Preference -from rigo.models.group import Group +from _entropy.rigo.enums import Icons, RigoViewStates +from _entropy.rigo.utils import prepare_markup +from _entropy.rigo.models.preference import Preference +from _entropy.rigo.models.group import Group from entropy.const import const_debug_write from entropy.misc import ParallelTask diff --git a/rigo/rigo/ui/gtk3/controllers/noticeboard.py b/rigo/rigo/ui/gtk3/controllers/noticeboard.py index 5e6b8e760..8d9e24fd8 100644 --- a/rigo/rigo/ui/gtk3/controllers/noticeboard.py +++ b/rigo/rigo/ui/gtk3/controllers/noticeboard.py @@ -25,11 +25,11 @@ import tempfile from gi.repository import GObject, GLib -from rigo.paths import CONF_DIR -from rigo.ui.gtk3.widgets.notifications import \ +from _entropy.rigo.paths import CONF_DIR +from _entropy.rigo.ui.gtk3.widgets.notifications import \ NoticeBoardNotificationBox -from rigo.enums import RigoViewStates -from rigo.utils import open_url +from _entropy.rigo.enums import RigoViewStates +from _entropy.rigo.utils import open_url from entropy.cache import EntropyCacher from entropy.const import etpConst diff --git a/rigo/rigo/ui/gtk3/controllers/notifications.py b/rigo/rigo/ui/gtk3/controllers/notifications.py index 938464f21..d8e7688f9 100644 --- a/rigo/rigo/ui/gtk3/controllers/notifications.py +++ b/rigo/rigo/ui/gtk3/controllers/notifications.py @@ -21,8 +21,8 @@ this program; if not, write to the Free Software Foundation, Inc., from gi.repository import Gtk, GLib, GObject -from rigo.enums import LocalActivityStates -from rigo.ui.gtk3.widgets.notifications import NotificationBox, \ +from _entropy.rigo.enums import LocalActivityStates +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox, \ ConnectivityNotificationBox from entropy.misc import ParallelTask diff --git a/rigo/rigo/ui/gtk3/controllers/repository.py b/rigo/rigo/ui/gtk3/controllers/repository.py index 049254b02..98a5a8f9e 100644 --- a/rigo/rigo/ui/gtk3/controllers/repository.py +++ b/rigo/rigo/ui/gtk3/controllers/repository.py @@ -24,12 +24,12 @@ import errno from gi.repository import Gtk, GObject, GLib -from rigo.enums import Icons, RigoViewStates -from rigo.utils import prepare_markup -from rigo.models.repository import Repository -from rigo.ui.gtk3.widgets.notifications import NotificationBox, \ +from _entropy.rigo.enums import Icons, RigoViewStates +from _entropy.rigo.utils import prepare_markup +from _entropy.rigo.models.repository import Repository +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox, \ RenameRepositoryNotificationBox -from rigo.models.preference import Preference +from _entropy.rigo.models.preference import Preference from entropy.const import const_debug_write from entropy.misc import ParallelTask diff --git a/rigo/rigo/ui/gtk3/controllers/work.py b/rigo/rigo/ui/gtk3/controllers/work.py index d17917805..b16eb52ee 100644 --- a/rigo/rigo/ui/gtk3/controllers/work.py +++ b/rigo/rigo/ui/gtk3/controllers/work.py @@ -22,11 +22,11 @@ import os from gi.repository import GObject, GLib, Gtk, GdkPixbuf, Pango -from rigo.ui.gtk3.widgets.stars import Star -from rigo.ui.gtk3.widgets.terminal import TerminalWidget +from _entropy.rigo.ui.gtk3.widgets.stars import Star +from _entropy.rigo.ui.gtk3.widgets.terminal import TerminalWidget -from rigo.enums import Icons -from rigo.utils import escape_markup, prepare_markup +from _entropy.rigo.enums import Icons +from _entropy.rigo.utils import escape_markup, prepare_markup from RigoDaemon.enums import AppActions as DaemonAppActions from entropy.i18n import _, ngettext diff --git a/rigo/rigo/ui/gtk3/models/appliststore.py b/rigo/rigo/ui/gtk3/models/appliststore.py index 92d378a4d..41b0ecc43 100644 --- a/rigo/rigo/ui/gtk3/models/appliststore.py +++ b/rigo/rigo/ui/gtk3/models/appliststore.py @@ -23,8 +23,8 @@ from threading import Lock, Semaphore from gi.repository import Gtk, GLib, GObject, GdkPixbuf -from rigo.enums import Icons -from rigo.models.application import Application, ApplicationMetadata +from _entropy.rigo.enums import Icons +from _entropy.rigo.models.application import Application, ApplicationMetadata from entropy.const import const_debug_write, const_debug_enabled diff --git a/rigo/rigo/ui/gtk3/utils.py b/rigo/rigo/ui/gtk3/utils.py index 61fba165a..e3d41ce55 100644 --- a/rigo/rigo/ui/gtk3/utils.py +++ b/rigo/rigo/ui/gtk3/utils.py @@ -28,7 +28,7 @@ from gi.repository import Gtk, GdkPixbuf, GObject from entropy.const import const_mkstemp -from rigo.paths import ICON_PATH +from _entropy.rigo.paths import ICON_PATH LOG = logging.getLogger(__name__) diff --git a/rigo/rigo/ui/gtk3/widgets/apptreeview.py b/rigo/rigo/ui/gtk3/widgets/apptreeview.py index b34fafcc4..111e98287 100644 --- a/rigo/rigo/ui/gtk3/widgets/apptreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/apptreeview.py @@ -27,10 +27,10 @@ from entropy.i18n import _ from .cellrenderers import CellRendererAppView, CellButtonRenderer, \ CellButtonIDs -from rigo.em import em, StockEms -from rigo.enums import Icons, AppActions -from rigo.models.application import Application -from rigo.ui.gtk3.widgets.generictreeview import GenericTreeView +from _entropy.rigo.em import em, StockEms +from _entropy.rigo.enums import Icons, AppActions +from _entropy.rigo.models.application import Application +from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView from RigoDaemon.enums import AppActions as DaemonAppActions, \ ActivityStates as DaemonActivityStates diff --git a/rigo/rigo/ui/gtk3/widgets/cellrenderers.py b/rigo/rigo/ui/gtk3/widgets/cellrenderers.py index 78db031c9..2c719139b 100644 --- a/rigo/rigo/ui/gtk3/widgets/cellrenderers.py +++ b/rigo/rigo/ui/gtk3/widgets/cellrenderers.py @@ -25,9 +25,9 @@ from gi.repository import GLib, Gtk, Gdk, GObject, Pango from threading import Lock, Timer -from rigo.em import Ems -from rigo.utils import escape_markup -from rigo.enums import Icons +from _entropy.rigo.em import Ems +from _entropy.rigo.utils import escape_markup +from _entropy.rigo.enums import Icons from .stars import StarRenderer, StarSize diff --git a/rigo/rigo/ui/gtk3/widgets/comments.py b/rigo/rigo/ui/gtk3/widgets/comments.py index fb7030390..cf4f67077 100644 --- a/rigo/rigo/ui/gtk3/widgets/comments.py +++ b/rigo/rigo/ui/gtk3/widgets/comments.py @@ -20,8 +20,8 @@ this program; if not, write to the Free Software Foundation, Inc., """ from gi.repository import Gtk, Pango, GObject, GLib -from rigo.utils import escape_markup -from rigo.ui.gtk3.widgets.notifications import NotificationBox +from _entropy.rigo.utils import escape_markup +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox from entropy.i18n import _ from entropy.misc import ParallelTask diff --git a/rigo/rigo/ui/gtk3/widgets/confupdatetreeview.py b/rigo/rigo/ui/gtk3/widgets/confupdatetreeview.py index 34fb260b8..a33e6b42d 100644 --- a/rigo/rigo/ui/gtk3/widgets/confupdatetreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/confupdatetreeview.py @@ -27,10 +27,11 @@ from entropy.i18n import _ from .cellrenderers import CellButtonRenderer, \ CellRendererConfigUpdateView, ConfigUpdateCellButtonIDs -from rigo.em import em, StockEms, Ems -from rigo.ui.gtk3.models.confupdateliststore import ConfigUpdatesListStore +from _entropy.rigo.em import em, StockEms, Ems +from _entropy.rigo.ui.gtk3.models.confupdateliststore import \ + ConfigUpdatesListStore -from rigo.ui.gtk3.widgets.generictreeview import GenericTreeView +from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView class ConfigUpdatesTreeView(GenericTreeView): diff --git a/rigo/rigo/ui/gtk3/widgets/generictreeview.py b/rigo/rigo/ui/gtk3/widgets/generictreeview.py index bbb3ef590..5b252fd0f 100644 --- a/rigo/rigo/ui/gtk3/widgets/generictreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/generictreeview.py @@ -22,7 +22,7 @@ this program; if not, write to the Free Software Foundation, Inc., """ from gi.repository import Gtk, Gdk, GObject -from rigo.em import em, StockEms, Ems +from _entropy.rigo.em import em, StockEms, Ems class GenericTreeView(Gtk.TreeView): diff --git a/rigo/rigo/ui/gtk3/widgets/grouptreeview.py b/rigo/rigo/ui/gtk3/widgets/grouptreeview.py index d2342ed54..de94fb611 100644 --- a/rigo/rigo/ui/gtk3/widgets/grouptreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/grouptreeview.py @@ -23,9 +23,9 @@ from gi.repository import Gtk, GObject from .cellrenderers import CellButtonRenderer, CellRendererGroupView, \ GroupCellButtonIDs -from rigo.ui.gtk3.models.groupliststore import GroupListStore +from _entropy.rigo.ui.gtk3.models.groupliststore import GroupListStore -from rigo.ui.gtk3.widgets.generictreeview import GenericTreeView +from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView from entropy.i18n import _ diff --git a/rigo/rigo/ui/gtk3/widgets/images.py b/rigo/rigo/ui/gtk3/widgets/images.py index 516e31bb0..f38c280f9 100644 --- a/rigo/rigo/ui/gtk3/widgets/images.py +++ b/rigo/rigo/ui/gtk3/widgets/images.py @@ -23,12 +23,12 @@ from threading import Lock from gi.repository import Gtk, Gdk, Pango, GObject, GdkPixbuf -from rigo.utils import escape_markup -from rigo.ui.gtk3.utils import get_sc_icon_theme -from rigo.paths import DATA_DIR -from rigo.enums import Icons -from rigo.utils import open_url -from rigo.ui.gtk3.models.appliststore import AppListStore +from _entropy.rigo.utils import escape_markup +from _entropy.rigo.ui.gtk3.utils import get_sc_icon_theme +from _entropy.rigo.paths import DATA_DIR +from _entropy.rigo.enums import Icons +from _entropy.rigo.utils import open_url +from _entropy.rigo.ui.gtk3.models.appliststore import AppListStore from entropy.client.services.interfaces import Document, DocumentFactory from entropy.i18n import _ diff --git a/rigo/rigo/ui/gtk3/widgets/noticeboardtreeview.py b/rigo/rigo/ui/gtk3/widgets/noticeboardtreeview.py index c2afc60ed..7d54bf8da 100644 --- a/rigo/rigo/ui/gtk3/widgets/noticeboardtreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/noticeboardtreeview.py @@ -23,10 +23,11 @@ from gi.repository import Gtk, GObject from .cellrenderers import CellButtonRenderer, CellRendererNoticeView, \ NoticeCellButtonIDs -from rigo.utils import open_url -from rigo.ui.gtk3.models.noticeboardliststore import NoticeBoardListStore +from _entropy.rigo.utils import open_url +from _entropy.rigo.ui.gtk3.models.noticeboardliststore import \ + NoticeBoardListStore -from rigo.ui.gtk3.widgets.generictreeview import GenericTreeView +from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView class NoticeBoardTreeView(GenericTreeView): diff --git a/rigo/rigo/ui/gtk3/widgets/notifications.py b/rigo/rigo/ui/gtk3/widgets/notifications.py index ca9a70392..1537486e1 100644 --- a/rigo/rigo/ui/gtk3/widgets/notifications.py +++ b/rigo/rigo/ui/gtk3/widgets/notifications.py @@ -25,11 +25,11 @@ from threading import Timer, Semaphore, Lock from gi.repository import Gtk, GLib, GObject, Pango -from rigo.em import StockEms -from rigo.utils import build_register_url, open_url, escape_markup, \ +from _entropy.rigo.em import StockEms +from _entropy.rigo.utils import build_register_url, open_url, escape_markup, \ prepare_markup -from rigo.models.application import Application -from rigo.enums import AppActions, LocalActivityStates, RigoViewStates +from _entropy.rigo.models.application import Application +from _entropy.rigo.enums import AppActions, LocalActivityStates, RigoViewStates from entropy.const import etpConst, const_convert_to_unicode, \ const_debug_write, const_mkstemp diff --git a/rigo/rigo/ui/gtk3/widgets/preferencestreeview.py b/rigo/rigo/ui/gtk3/widgets/preferencestreeview.py index cdaa22506..9c7f4d087 100644 --- a/rigo/rigo/ui/gtk3/widgets/preferencestreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/preferencestreeview.py @@ -23,9 +23,10 @@ from gi.repository import Gtk, GObject from .cellrenderers import CellButtonRenderer, CellRendererPreferenceView, \ PreferenceCellButtonIDs -from rigo.ui.gtk3.models.preferencesliststore import PreferencesListStore +from _entropy.rigo.ui.gtk3.models.preferencesliststore import \ + PreferencesListStore -from rigo.ui.gtk3.widgets.generictreeview import GenericTreeView +from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView from entropy.i18n import _ diff --git a/rigo/rigo/ui/gtk3/widgets/repositorytreeview.py b/rigo/rigo/ui/gtk3/widgets/repositorytreeview.py index 2baed546c..620aa2ce3 100644 --- a/rigo/rigo/ui/gtk3/widgets/repositorytreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/repositorytreeview.py @@ -23,8 +23,8 @@ from gi.repository import Gtk, GObject from .cellrenderers import CellButtonRenderer, CellRendererRepositoryView, \ RepositoryCellButtonIDs -from rigo.ui.gtk3.models.repositoryliststore import RepositoryListStore -from rigo.ui.gtk3.widgets.generictreeview import GenericTreeView +from _entropy.rigo.ui.gtk3.models.repositoryliststore import RepositoryListStore +from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView class RepositoryTreeView(GenericTreeView): diff --git a/rigo/rigo/ui/gtk3/widgets/stars.py b/rigo/rigo/ui/gtk3/widgets/stars.py index 18e2c7292..007e8fde2 100644 --- a/rigo/rigo/ui/gtk3/widgets/stars.py +++ b/rigo/rigo/ui/gtk3/widgets/stars.py @@ -29,8 +29,8 @@ from gi.repository import Gtk, Gdk, GObject from entropy.i18n import _ -from rigo.shapes import ShapeStar -from rigo.em import StockEms, em, small_em, big_em +from _entropy.rigo.shapes import ShapeStar +from _entropy.rigo.em import StockEms, em, small_em, big_em _star_surface_cache = {} diff --git a/rigo/rigo/ui/gtk3/widgets/terminal.py b/rigo/rigo/ui/gtk3/widgets/terminal.py index 486901a40..382d5a728 100644 --- a/rigo/rigo/ui/gtk3/widgets/terminal.py +++ b/rigo/rigo/ui/gtk3/widgets/terminal.py @@ -29,8 +29,8 @@ from gi.repository import Vte, Gdk from entropy.const import etpConst, const_isunicode -from rigo.paths import CONF_DIR -from rigo.utils import prepare_markup +from _entropy.rigo.paths import CONF_DIR +from _entropy.rigo.utils import prepare_markup import entropy.tools from entropy.const import etpConst diff --git a/rigo/rigo/ui/gtk3/widgets/welcome.py b/rigo/rigo/ui/gtk3/widgets/welcome.py index 33131797d..2d277da8d 100644 --- a/rigo/rigo/ui/gtk3/widgets/welcome.py +++ b/rigo/rigo/ui/gtk3/widgets/welcome.py @@ -22,7 +22,7 @@ import os from gi.repository import Gtk -from rigo.paths import DATA_DIR +from _entropy.rigo.paths import DATA_DIR from entropy.i18n import _ diff --git a/rigo/rigo_app.py b/rigo/rigo_app.py index f35708f21..0ad1295ab 100644 --- a/rigo/rigo_app.py +++ b/rigo/rigo_app.py @@ -34,51 +34,58 @@ _base = osp.dirname(osp.dirname(osp.realpath(__file__))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) import entropy_path_loader - entropy_path_loader.add_import_path("rigo") del osp from gi.repository import Gtk, Gdk, GLib -from rigo.paths import DATA_DIR -from rigo.enums import RigoViewStates, LocalActivityStates -from rigo.entropyapi import EntropyWebService, EntropyClient as Client -from rigo.ui.gtk3.widgets.apptreeview import AppTreeView -from rigo.ui.gtk3.widgets.confupdatetreeview import ConfigUpdatesTreeView -from rigo.ui.gtk3.widgets.noticeboardtreeview import NoticeBoardTreeView -from rigo.ui.gtk3.widgets.preferencestreeview import PreferencesTreeView -from rigo.ui.gtk3.widgets.grouptreeview import GroupTreeView -from rigo.ui.gtk3.widgets.repositorytreeview import RepositoryTreeView -from rigo.ui.gtk3.widgets.notifications import NotificationBox -from rigo.ui.gtk3.controllers.applications import \ +from _entropy.rigo.paths import DATA_DIR +from _entropy.rigo.enums import RigoViewStates, LocalActivityStates +from _entropy.rigo.entropyapi import EntropyWebService, EntropyClient as Client +from _entropy.rigo.ui.gtk3.widgets.apptreeview import AppTreeView +from _entropy.rigo.ui.gtk3.widgets.confupdatetreeview import \ + ConfigUpdatesTreeView +from _entropy.rigo.ui.gtk3.widgets.noticeboardtreeview import \ + NoticeBoardTreeView +from _entropy.rigo.ui.gtk3.widgets.preferencestreeview import \ + PreferencesTreeView +from _entropy.rigo.ui.gtk3.widgets.grouptreeview import GroupTreeView +from _entropy.rigo.ui.gtk3.widgets.repositorytreeview import RepositoryTreeView +from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox +from _entropy.rigo.ui.gtk3.controllers.applications import \ ApplicationsViewController -from rigo.ui.gtk3.controllers.application import \ +from _entropy.rigo.ui.gtk3.controllers.application import \ ApplicationViewController -from rigo.ui.gtk3.controllers.confupdate import \ +from _entropy.rigo.ui.gtk3.controllers.confupdate import \ ConfigUpdatesViewController -from rigo.ui.gtk3.controllers.noticeboard import \ +from _entropy.rigo.ui.gtk3.controllers.noticeboard import \ NoticeBoardViewController -from rigo.ui.gtk3.controllers.preference import \ +from _entropy.rigo.ui.gtk3.controllers.preference import \ PreferenceViewController -from rigo.ui.gtk3.controllers.repository import \ +from _entropy.rigo.ui.gtk3.controllers.repository import \ RepositoryViewController -from rigo.ui.gtk3.controllers.group import \ +from _entropy.rigo.ui.gtk3.controllers.group import \ GroupViewController -from rigo.ui.gtk3.controllers.notifications import \ +from _entropy.rigo.ui.gtk3.controllers.notifications import \ UpperNotificationViewController, BottomNotificationViewController -from rigo.ui.gtk3.controllers.work import \ +from _entropy.rigo.ui.gtk3.controllers.work import \ WorkViewController -from rigo.ui.gtk3.widgets.welcome import WelcomeBox -from rigo.ui.gtk3.models.appliststore import AppListStore -from rigo.ui.gtk3.models.confupdateliststore import ConfigUpdatesListStore -from rigo.ui.gtk3.models.noticeboardliststore import NoticeBoardListStore -from rigo.ui.gtk3.models.preferencesliststore import PreferencesListStore -from rigo.ui.gtk3.models.groupliststore import GroupListStore -from rigo.ui.gtk3.models.repositoryliststore import RepositoryListStore -from rigo.ui.gtk3.utils import init_sc_css_provider, get_sc_icon_theme +from _entropy.rigo.ui.gtk3.widgets.welcome import WelcomeBox +from _entropy.rigo.ui.gtk3.models.appliststore import AppListStore +from _entropy.rigo.ui.gtk3.models.confupdateliststore import \ + ConfigUpdatesListStore +from _entropy.rigo.ui.gtk3.models.noticeboardliststore import \ + NoticeBoardListStore +from _entropy.rigo.ui.gtk3.models.preferencesliststore import \ + PreferencesListStore +from _entropy.rigo.ui.gtk3.models.groupliststore import \ + GroupListStore +from _entropy.rigo.ui.gtk3.models.repositoryliststore import \ + RepositoryListStore +from _entropy.rigo.ui.gtk3.utils import init_sc_css_provider, get_sc_icon_theme -from rigo.utils import escape_markup -from rigo.controllers.daemon import RigoServiceController +from _entropy.rigo.utils import escape_markup +from _entropy.rigo.controllers.daemon import RigoServiceController from RigoDaemon.enums import ActivityStates as DaemonActivityStates From ed93a3737d2d150287346b86736ca8639e22ee65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 08/10] update RigoDaemon imports --- entropy_path_loader/compat/_entropy/__init__.py | 3 +++ magneto/src/magneto/core/interfaces.py | 4 ++-- rigo/RigoDaemon/app/RigoDaemon_app.py | 6 +++--- rigo/rigo/controllers/daemon.py | 5 +++-- rigo/rigo/ui/gtk3/controllers/application.py | 2 +- rigo/rigo/ui/gtk3/controllers/work.py | 2 +- rigo/rigo/ui/gtk3/widgets/apptreeview.py | 2 +- rigo/rigo_app.py | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/entropy_path_loader/compat/_entropy/__init__.py b/entropy_path_loader/compat/_entropy/__init__.py index 68de2416e..fb6622bc6 100644 --- a/entropy_path_loader/compat/_entropy/__init__.py +++ b/entropy_path_loader/compat/_entropy/__init__.py @@ -27,3 +27,6 @@ sys.modules['_entropy.matter'] = matter import rigo sys.modules['_entropy.rigo'] = rigo + +import RigoDaemon +sys.modules['_entropy.RigoDaemon'] = RigoDaemon diff --git a/magneto/src/magneto/core/interfaces.py b/magneto/src/magneto/core/interfaces.py index 22a5ed10d..66c285e81 100644 --- a/magneto/src/magneto/core/interfaces.py +++ b/magneto/src/magneto/core/interfaces.py @@ -31,8 +31,8 @@ from entropy.misc import ParallelTask from _entropy.magneto.core import config # RigoDaemon imports -from RigoDaemon.config import DbusConfig -from RigoDaemon.enums import ActivityStates +from _entropy.RigoDaemon.config import DbusConfig +from _entropy.RigoDaemon.enums import ActivityStates class MagnetoIconMap(object): diff --git a/rigo/RigoDaemon/app/RigoDaemon_app.py b/rigo/RigoDaemon/app/RigoDaemon_app.py index be402e765..384ba5fc3 100755 --- a/rigo/RigoDaemon/app/RigoDaemon_app.py +++ b/rigo/RigoDaemon/app/RigoDaemon_app.py @@ -95,10 +95,10 @@ import kswitch import entropy.tools import entropy.dep -from RigoDaemon.enums import ActivityStates, AppActions, \ +from _entropy.RigoDaemon.enums import ActivityStates, AppActions, \ AppTransactionOutcome, AppTransactionStates -from RigoDaemon.config import DbusConfig, PolicyActions -from RigoDaemon.authentication import AuthenticationController +from _entropy.RigoDaemon.config import DbusConfig, PolicyActions +from _entropy.RigoDaemon.authentication import AuthenticationController TEXT = TextInterface() DAEMON_LOGFILE = os.path.join(etpConst['syslogdir'], "rigo-daemon.log") diff --git a/rigo/rigo/controllers/daemon.py b/rigo/rigo/controllers/daemon.py index aa6bec120..7726d0a69 100644 --- a/rigo/rigo/controllers/daemon.py +++ b/rigo/rigo/controllers/daemon.py @@ -42,11 +42,12 @@ from _entropy.rigo.ui.gtk3.widgets.notifications import NotificationBox, \ from _entropy.rigo.utils import prepare_markup -from RigoDaemon.enums import ActivityStates as DaemonActivityStates, \ +from _entropy.RigoDaemon.enums import \ + ActivityStates as DaemonActivityStates, \ AppActions as DaemonAppActions, \ AppTransactionOutcome as DaemonAppTransactionOutcome, \ AppTransactionStates as DaemonAppTransactionStates -from RigoDaemon.config import DbusConfig as DaemonDbusConfig +from _entropy.RigoDaemon.config import DbusConfig as DaemonDbusConfig from entropy.const import const_debug_write, \ const_debug_enabled, etpConst diff --git a/rigo/rigo/ui/gtk3/controllers/application.py b/rigo/rigo/ui/gtk3/controllers/application.py index f2916b2b6..a6d1cc05b 100644 --- a/rigo/rigo/ui/gtk3/controllers/application.py +++ b/rigo/rigo/ui/gtk3/controllers/application.py @@ -32,7 +32,7 @@ from _entropy.rigo.utils import build_application_store_url, \ escape_markup, prepare_markup from _entropy.rigo.models.preference import Preference -from RigoDaemon.enums import AppActions as DaemonAppActions, \ +from _entropy.RigoDaemon.enums import AppActions as DaemonAppActions, \ ActivityStates as DaemonActivityStates from entropy.const import etpConst, const_debug_write, \ diff --git a/rigo/rigo/ui/gtk3/controllers/work.py b/rigo/rigo/ui/gtk3/controllers/work.py index b16eb52ee..9ff481f1d 100644 --- a/rigo/rigo/ui/gtk3/controllers/work.py +++ b/rigo/rigo/ui/gtk3/controllers/work.py @@ -27,7 +27,7 @@ from _entropy.rigo.ui.gtk3.widgets.terminal import TerminalWidget from _entropy.rigo.enums import Icons from _entropy.rigo.utils import escape_markup, prepare_markup -from RigoDaemon.enums import AppActions as DaemonAppActions +from _entropy.RigoDaemon.enums import AppActions as DaemonAppActions from entropy.i18n import _, ngettext diff --git a/rigo/rigo/ui/gtk3/widgets/apptreeview.py b/rigo/rigo/ui/gtk3/widgets/apptreeview.py index 111e98287..e7f0ca61e 100644 --- a/rigo/rigo/ui/gtk3/widgets/apptreeview.py +++ b/rigo/rigo/ui/gtk3/widgets/apptreeview.py @@ -32,7 +32,7 @@ from _entropy.rigo.enums import Icons, AppActions from _entropy.rigo.models.application import Application from _entropy.rigo.ui.gtk3.widgets.generictreeview import GenericTreeView -from RigoDaemon.enums import AppActions as DaemonAppActions, \ +from _entropy.RigoDaemon.enums import AppActions as DaemonAppActions, \ ActivityStates as DaemonActivityStates diff --git a/rigo/rigo_app.py b/rigo/rigo_app.py index 0ad1295ab..c500961c4 100644 --- a/rigo/rigo_app.py +++ b/rigo/rigo_app.py @@ -87,7 +87,7 @@ from _entropy.rigo.ui.gtk3.utils import init_sc_css_provider, get_sc_icon_theme from _entropy.rigo.utils import escape_markup from _entropy.rigo.controllers.daemon import RigoServiceController -from RigoDaemon.enums import ActivityStates as DaemonActivityStates +from _entropy.RigoDaemon.enums import ActivityStates as DaemonActivityStates from entropy.const import const_debug_write, dump_signal from entropy.misc import TimeScheduled, ParallelTask, ReadersWritersSemaphore From 7fe54dc2e04d58b3e4f8312d5464ea67de588a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 20:15:36 +0100 Subject: [PATCH 09/10] [entropy_path_loader] make _add_import_path private --- entropy_path_loader/entropy_path_loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entropy_path_loader/entropy_path_loader.py b/entropy_path_loader/entropy_path_loader.py index f1794f187..e06c84abf 100644 --- a/entropy_path_loader/entropy_path_loader.py +++ b/entropy_path_loader/entropy_path_loader.py @@ -20,7 +20,7 @@ base_dir = osp.dirname(osp.dirname(osp.realpath(__file__))) in_checkout = osp.isfile(osp.join(base_dir, "entropy-in-vcs-checkout")) -def add_import_path(path): +def _add_import_path(path): if not in_checkout: raise RuntimeError( "entropy_path_loader used when not in checkout") @@ -39,4 +39,4 @@ mod_paths = ( ) for path in mod_paths: - add_import_path(path) + _add_import_path(path) From 545b5a7ca4b6b51cb9c1c6242433aa0ed2bee6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Mon, 26 Nov 2018 21:02:54 +0100 Subject: [PATCH 10/10] [tests] fix import path It couldn't find and load _entropy.solo.commands.pkg. --- lib/tests/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tests/client.py b/lib/tests/client.py index ac195fec9..d30fe6b53 100644 --- a/lib/tests/client.py +++ b/lib/tests/client.py @@ -1,15 +1,17 @@ # -*- coding: utf-8 -*- import sys -sys.path.insert(0, 'client') -sys.path.insert(0, '../../client') -sys.path.insert(0, '.') -sys.path.insert(0, '../') import unittest import os import shutil import signal import time +from os import path as osp +_base = osp.dirname(osp.dirname(osp.dirname(osp.realpath(__file__)))) +sys.path.insert(0, osp.join(_base, "entropy_path_loader")) +import entropy_path_loader +del osp + from entropy.client.interfaces import Client from entropy.client.interfaces.db import InstalledPackagesRepository from entropy.client.interfaces.package.actions._triggers import Trigger