Files
entropy/client/solo/commands/__init__.py
T
Sławomir Nizio 7cf7e1f6b7 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.)
2018-11-26 20:15:36 +01:00

32 lines
686 B
Python

# -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Command Line Client}.
"""
import os
import sys
_cur_file = sys.modules[__name__].__file__
_cur_dir = os.path.dirname(_cur_file)
_excluded_mods = ["descriptor"]
for py_file in os.listdir(_cur_dir):
if not py_file.endswith(".py"):
continue
if py_file.startswith("_"):
continue
# strip .py
_mod = "_entropy.solo.commands." + py_file[:-3]
if _mod in _excluded_mods:
continue
try:
__import__(_mod)
except ValueError:
# garbage
continue