diff options
| author | scarabeus <scarabeus@gentoo.org> | 2010-10-28 21:31:47 +0000 |
|---|---|---|
| committer | scarabeus <scarabeus@gentoo.org> | 2010-10-28 21:31:47 +0000 |
| commit | a09461df542c3a56f9d2e6a8d15fbf1e4f8f4509 (patch) | |
| tree | 42006bb6ad59d8713142288246fa9e4b60180217 | |
| parent | 7736c7d22e9c5692fef8b73a3a27bf9c6c101918 (diff) | |
| download | gentoolkit-a09461df542c3a56f9d2e6a8d15fbf1e4f8f4509.tar.gz | |
Fix import path again. Process only proper passed args in required function.
svn path=/trunk/gentoolkit/; revision=838
| -rw-r--r-- | pym/gentoolkit/equery/keywords.py | 4 | ||||
| -rw-r--r-- | pym/gentoolkit/eshowkw/__init__.py | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/pym/gentoolkit/equery/keywords.py b/pym/gentoolkit/equery/keywords.py index f876510..e9ec5eb 100644 --- a/pym/gentoolkit/equery/keywords.py +++ b/pym/gentoolkit/equery/keywords.py @@ -2,6 +2,8 @@ # Distributed under the terms of the GNU General Public License v2 import sys -from ...gentoolkit.eshowkw import main as emain +from gentoolkit.eshowkw import main as emain +# we have equery as first argument instead of the scriptname +# so we will just ommit it emain(sys.argv) diff --git a/pym/gentoolkit/eshowkw/__init__.py b/pym/gentoolkit/eshowkw/__init__.py index 672996c..a6f1ff4 100644 --- a/pym/gentoolkit/eshowkw/__init__.py +++ b/pym/gentoolkit/eshowkw/__init__.py @@ -79,6 +79,10 @@ def process_args(argv): def main(argv): global ignore_slots, bold, order, topper + # equery support + if argv[0] = 'equery': + pkgsearch_only = True + #opts parsing opts = process_args(argv) ignore_slots = opts.ignore_slot @@ -93,6 +97,12 @@ def main(argv): prefix = opts.prefix color = opts.color package = opts.package + + # equery support + if pkgsearch_only and len(package) <= 0: + msg_err = 'No packages specified' + raise SystemExit(msg_err) + # disable colors when redirected and they are not forced on if not color and not sys.stdout.isatty(): # disable colors |
