diff options
Diffstat (limited to 'pym')
| -rw-r--r-- | pym/gentoolkit/enalyze/analyze.py | 19 | ||||
| -rw-r--r-- | pym/gentoolkit/enalyze/rebuild.py | 10 | ||||
| -rw-r--r-- | pym/gentoolkit/module_base.py | 9 |
3 files changed, 32 insertions, 6 deletions
diff --git a/pym/gentoolkit/enalyze/analyze.py b/pym/gentoolkit/enalyze/analyze.py index 7033422..e068351 100644 --- a/pym/gentoolkit/enalyze/analyze.py +++ b/pym/gentoolkit/enalyze/analyze.py @@ -165,7 +165,8 @@ class Analyse(ModuleBase): """ def __init__(self): ModuleBase.__init__(self) - self.module_name = "enalyze" + self.command_name = "enalyze" + self.module_name = "analyze" self.options = { "flags": False, "keywords": False, @@ -220,12 +221,16 @@ class Analyse(ModuleBase): "Causes the action to analyze the installed packages and the"), (" ", "USE flags they were installed with"), + (" unmask", + "Causes the action to analyze the installed packages"), + (" ", + "for those that need to be unmasked") ] self.short_opts = "huvpG" self.long_opts = ("help", "unset", "verbose", "prefix") #, "portage") self.need_queries = True self.arg_spec = "Target" - self.arg_options = ['use', 'pkguse','keywords', 'packages'] + self.arg_options = ['use', 'pkguse','keywords', 'packages', 'unmask'] self.arg_option = False self.warning = ( " CAUTION", @@ -248,6 +253,8 @@ class Analyse(ModuleBase): self.analyse_keywords() elif query in ["packages"]: self.analyse_packages() + elif query in ["unmask"]: + self.analyse_unmask() def analyse_flags(self, target): """This will scan the installed packages db and analyze the @@ -435,6 +442,14 @@ class Analyse(ModuleBase): print() + def analyse_unmask(self): + """This will scan the installed packages db and analyze the + unmasking used for installation and produce a report on them. + """ + self.not_implemented("unmask") + + + def main(input_args): """Common starting method by the analyze master unless all modules are converted to this class method. diff --git a/pym/gentoolkit/enalyze/rebuild.py b/pym/gentoolkit/enalyze/rebuild.py index cd1a08a..778fed4 100644 --- a/pym/gentoolkit/enalyze/rebuild.py +++ b/pym/gentoolkit/enalyze/rebuild.py @@ -146,6 +146,7 @@ class Rebuild(ModuleBase): """ def __init__(self): ModuleBase.__init__(self) + self.command_name = "enalyze" self.module_name = "rebuild" self.options = { "use": False, @@ -235,6 +236,7 @@ class Rebuild(ModuleBase): print((pp.emph(" -- Found ") + pp.number(str(pkg_count)) + pp.emph(" packages that need entries"))) #print pp.emph(" package.use to maintain their current setting") + pkg_keys = [] if pkgs: pkg_keys = sorted(pkgs) #print len(pkgs) @@ -266,8 +268,8 @@ class Rebuild(ModuleBase): self.save_file(filepath, output.lines) def rebuild_keywords(self): - print("Module action not yet available") - print() + #print("Module action not yet available") + #print() """This will scan the installed packages db and analyze the keywords used for installation and produce a report on them. """ @@ -303,6 +305,7 @@ class Rebuild(ModuleBase): analyser = self.analyser ) #print([pkgs[p][0].cpv for p in pkgs]) + pkg_keys = [] if pkgs: pkg_keys = sorted(pkgs) #print(len(pkgs)) @@ -338,8 +341,7 @@ class Rebuild(ModuleBase): def rebuild_unmask(self): - print("Module action not yet available") - print() + self.not_implemented("unmask") def save_file(self, filepath, data): diff --git a/pym/gentoolkit/module_base.py b/pym/gentoolkit/module_base.py index f8a6774..87e04f1 100644 --- a/pym/gentoolkit/module_base.py +++ b/pym/gentoolkit/module_base.py @@ -145,4 +145,13 @@ class ModuleBase(object): return queries + def not_implemented(self, target): + """Prints a standard module not implemented message""" + print() + print(pp.error( + "Sorry %s module and/or target is not implenented yet." + % pp.emph(self.command_name))) + print("module: %s, target: %s" %(pp.emph(self.module_name), pp.emph(target))) + print() + # vim: set ts=4 sw=4 tw=79: |
