summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-01-25 09:00:31 -0800
committerBrian Dolbec <brian.dolbec@gmail.com>2011-01-25 09:00:31 -0800
commit9ec42c9f0e5ba0d0f2439b08a25263df2d367dfa (patch)
tree5840fd1adbeb8e42a1418384639ed55cdacd6e2c
parent291164632c4f154019f95cd7e35374b03b5d0579 (diff)
downloadgentoolkit-9ec42c9f0e5ba0d0f2439b08a25263df2d367dfa.tar.gz
fix the setting of the quiet option properly this time
-rw-r--r--pym/gentoolkit/analyse/analyse.py1
-rw-r--r--pym/gentoolkit/analyse/base.py17
2 files changed, 16 insertions, 2 deletions
diff --git a/pym/gentoolkit/analyse/analyse.py b/pym/gentoolkit/analyse/analyse.py
index 7e47724..275bbc0 100644
--- a/pym/gentoolkit/analyse/analyse.py
+++ b/pym/gentoolkit/analyse/analyse.py
@@ -242,6 +242,7 @@ class Analyse(ModuleBase):
"""
query = self.main_setup(input_args)
query = self.validate_query(query)
+ self.set_quiet(quiet)
if query in ["use", "pkguse"]:
self.analyse_flags(query)
elif query in ["keywords"]:
diff --git a/pym/gentoolkit/analyse/base.py b/pym/gentoolkit/analyse/base.py
index 8fe38db..a3f3fed 100644
--- a/pym/gentoolkit/analyse/base.py
+++ b/pym/gentoolkit/analyse/base.py
@@ -36,6 +36,7 @@ class ModuleBase(object):
self.module_opts = {}
self.warning = None
self.need_queries = True
+ self.saved_verbose = None
def print_help(self, with_description=True):
@@ -87,9 +88,21 @@ class ModuleBase(object):
self.print_help(with_description=False)
sys.exit(2)
self.options[opt_name] = val
- self.options['quiet'] = CONFIG["quiet"]
- if self.options['quiet']:
+
+ def set_quiet(self, quiet):
+ """sets the class option["quiet"] and option["verbose"] accordingly"""
+ if quiet == self.options['quiet']:
+ return
+ if self.saved_verbose:
+ # detected a switch
+ verbose = self.options['verbose']
+ self.options['verbose'] = self.saved_verbose
+ self.saved_verbose = verbose
+ elif quiet:
+ self.saved_verbose = self.options['verbose']
self.options['verbose'] = False
+ self.options['quiet'] = quiet
+ return
def validate_query(self, query, depth=0):
"""check that the query meets the modules TargetSpec