From: scarabeus Date: Thu, 28 Oct 2010 21:31:47 +0000 (-0000) Subject: Fix import path again. Process only proper passed args in required function. X-Git-Tag: gentoolkit-0.3.0_rc11~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a09461df542c3a56f9d2e6a8d15fbf1e4f8f4509;p=gentoolkit.git Fix import path again. Process only proper passed args in required function. svn path=/trunk/gentoolkit/; revision=838 --- 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