From 0e5d5476cf83af44597d20da1889f429e622c0ca Mon Sep 17 00:00:00 2001 From: necoro <> Date: Sat, 28 Oct 2006 09:11:59 +0000 Subject: Made newuse working --- geneticone/backend/portage_helper.py | 29 ++++++++++++++++++++++------- geneticone/gui/gtk/windows.py | 4 ++-- geneticone/gui/gtk/wrapper.py | 2 +- geneticone/gui/gui_helper.py | 10 +++++----- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/geneticone/backend/portage_helper.py b/geneticone/backend/portage_helper.py index 572d954..27f5a41 100644 --- a/geneticone/backend/portage_helper.py +++ b/geneticone/backend/portage_helper.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # File: geneticone/backend/portage_helper.py # This file is part of the Genetic/One-Project, a graphical portage-frontend. @@ -278,22 +279,36 @@ def update_world (newuse = False, deep = False): checked = [] updating = [] raw_checked = [] - def check (p, deep = False): + def check (p): """Checks whether a package is updated or not.""" if p.get_cp() in checked: return else: checked.append(p.get_cp()) + appended = False + tempDeep = False + if not p.is_installed(): - old = find_installed_packages(p.get_cp()) - if old: - old = old[0] # assume we have only one there; FIXME: slotted packages + oldList = find_installed_packages(p.get_cp()) + if oldList: + old = oldList[0] # assume we have only one there; FIXME: slotted packages else: debug("Bug? Not found installed one:",p.get_cp()) return updating.append((p, old)) + appended = True p = old - if deep: + if newuse: + old = p.get_installed_use_flags() + new = p.get_settings("USE").split() + + for u in p.get_all_use_flags(): + if (u in new) != (u in old): + if not appended: + updating.append((p,p)) + tempDeep = True + + if deep or tempDeep: for i in p.get_matched_dep_packages(): if i not in raw_checked: raw_checked.append(i) @@ -301,11 +316,11 @@ def update_world (newuse = False, deep = False): if not bm: debug("Bug? No best match could be found:",i) else: - check(bm, deep) + check(bm) for p in packages: if not p: continue # if a masked package is installed we have "None" here - check(p, deep) + check(p) return updating diff --git a/geneticone/gui/gtk/windows.py b/geneticone/gui/gtk/windows.py index 7b9dd94..efc4cce 100644 --- a/geneticone/gui/gtk/windows.py +++ b/geneticone/gui/gtk/windows.py @@ -195,7 +195,7 @@ class PreferenceWindow (AbstractDialog): self.deepCb = self.draw_cb(box, "--deep", "deep_opt") # --newuse - #self.newuseCb = self.draw_cb(box, "--newuse", "newuse_opt") + self.newuseCb = self.draw_cb(box, "--newuse", "newuse_opt") pHolderLabel = gtk.Label("""For the following options, you might use these placeholders: $(cat) = category @@ -282,7 +282,7 @@ class PreferenceWindow (AbstractDialog): self.cfg.set(self.cfg.const["testingFile_opt"], self.testFileEdit.get_text()) self.cfg.set(self.cfg.const["debug_opt"], str(self.debugCb.get_active())) self.cfg.set(self.cfg.const["deep_opt"], str(self.deepCb.get_active())) - #self.cfg.set(self.cfg.const["newuse_opt"], str(self.newuseCb.get_active())) + self.cfg.set(self.cfg.const["newuse_opt"], str(self.newuseCb.get_active())) def cb_ok_clicked(self, button): """Saves, writes to config-file and closes the window.""" diff --git a/geneticone/gui/gtk/wrapper.py b/geneticone/gui/gtk/wrapper.py index 4407816..6f3cdd8 100644 --- a/geneticone/gui/gtk/wrapper.py +++ b/geneticone/gui/gtk/wrapper.py @@ -36,7 +36,7 @@ class GtkTree (Tree): return self.tree.iter_children(it) def iter_has_children (self, it): - return self.tree.iter_has_children(it) + return self.tree.iter_has_child(it) def next_iter (self, it): return self.tree.iter_next(it) diff --git a/geneticone/gui/gui_helper.py b/geneticone/gui/gui_helper.py index 8afc137..81e26ef 100644 --- a/geneticone/gui/gui_helper.py +++ b/geneticone/gui/gui_helper.py @@ -291,7 +291,7 @@ class EmergeQueue: """This updates the tree recursivly, or? Isn't it? Bjorn! @param it: iterator where to append - @type it: gtk.TreeIter + @type it: Iterator @param cpv: The package to append. @type cpv: string (cat/pkg-ver) @param unmask: True if we are allowed to look for masked packages @@ -434,7 +434,7 @@ class EmergeQueue: @param packages: packages to emerge @type packages: list @param it: Iterators which point to these entries whose children will be removed after completion. - @type it: list of gtk.TreeIter""" + @type it: Iterator[]""" # open tty (master, slave) = pty.openpty() @@ -524,7 +524,7 @@ class EmergeQueue: """Convenience function which removes all children of an iterator and than the iterator itself. @param it: The iter which to remove. - @type it: gtk.TreeIter + @type it: Iterator @param removeNewFlags: True if new flags should be removed; False otherwise. Default: True. @type removeNewFlags: boolean""" @@ -535,7 +535,7 @@ class EmergeQueue: """Removes all children of a given parent TreeIter recursivly. @param parentIt: The iter from which to remove all children. - @type parentIt: gtk.TreeIter + @type parentIt: Iterator @param removeNewFlags: True if new flags should be removed; False otherwise. Default: True. @type removeNewFlags: boolean""" @@ -552,7 +552,7 @@ class EmergeQueue: """Removes a specific item in the tree. This does not remove the top-entries. @param it: Iterator which points to the entry we are going to remove. - @type it: gtk.TreeIter + @type it: Iterator @param removeNewFlags: True if new flags should be removed; False otherwise. Default: True. @type removeNewFlags: boolean""" -- cgit v1.2.3-54-g00ecf .ebuild?id=b9a237c62c9f786eb5264b37f38fdde30be21fba&follow=1'>Added newer PolyML version for IsabelleRené 'Necoro' Neumann2-0/+31 2010-01-05Removed bpythonRené 'Necoro' Neumann2-33/+0 2009-11-11stgit-0.15 in portage nowRené 'Necoro' Neumann2-59/+0 2009-11-10Add stgit-0.15René 'Necoro' Neumann2-0/+59 2009-11-09Emacs stuff now in PortageRené 'Necoro' Neumann8-2222/+0 2009-11-07Emacs with fixed gtk menusRené 'Necoro' Neumann8-0/+2222 2009-10-27Remove old hibernate-script version.René 'Necoro' Neumann2-72/+0 2009-10-25Rename .bzrignore to .gitignoreRené 'Necoro' Neumann1-0/+0 2009-10-25Rename repo from 'necoro_private' to 'necoro'René 'Necoro' Neumann1-1/+1 2009-10-25Remove own hplip versionRené 'Necoro' Neumann4-210/+0 2009-10-25Remove own ctags versionRené 'Necoro' Neumann7-402/+0 2009-10-02Do not create isabelle desktop entryRené 'Necoro' Neumann2-2/+1 2009-09-28Add isabelle ebuildRené 'Necoro' Neumann3-0/+115 2009-09-05Removed glade ebuild. Newer versions included in treeRené 'Necoro' Neumann2-47/+0