Patchwork [bitbake-devel,1/3] depexp: make parse() a member function

login
register
mail settings
Submitter Ross Burton
Date Aug. 5, 2013, 4:12 p.m.
Message ID <b23b666db43ca87f8648dece7b44ac4d2633b63c.1375718812.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/55149/
State New
Headers show

Comments

Ross Burton - Aug. 5, 2013, 4:12 p.m.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 bitbake/lib/bb/ui/depexp.py |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
index 885c31a..b7e6f8f 100644
--- a/bitbake/lib/bb/ui/depexp.py
+++ b/bitbake/lib/bb/ui/depexp.py
@@ -163,23 +163,23 @@  class DepExplorer(gtk.Window):
         self.revdep_treeview.set_current_package(current_package)
 
 
-def parse(depgraph, pkg_model, depends_model):
-    for package in depgraph["pn"]:
-        pkg_model.set(pkg_model.append(), COL_PKG_NAME, package)
+    def parse(self, depgraph):
+        for package in depgraph["pn"]:
+            self.pkg_model.set(self.pkg_model.append(), COL_PKG_NAME, package)
 
-    for package in depgraph["depends"]:
-        for depend in depgraph["depends"][package]:
-            depends_model.set (depends_model.append(),
-                              COL_DEP_TYPE, TYPE_DEP,
-                              COL_DEP_PARENT, package,
-                              COL_DEP_PACKAGE, depend)
+        for package in depgraph["depends"]:
+            for depend in depgraph["depends"][package]:
+                self.depends_model.set (self.depends_model.append(),
+                                        COL_DEP_TYPE, TYPE_DEP,
+                                        COL_DEP_PARENT, package,
+                                        COL_DEP_PACKAGE, depend)
 
-    for package in depgraph["rdepends-pn"]:
-        for rdepend in depgraph["rdepends-pn"][package]:
-            depends_model.set (depends_model.append(),
-                              COL_DEP_TYPE, TYPE_RDEP,
-                              COL_DEP_PARENT, package,
-                              COL_DEP_PACKAGE, rdepend)
+        for package in depgraph["rdepends-pn"]:
+            for rdepend in depgraph["rdepends-pn"][package]:
+                self.depends_model.set (self.depends_model.append(),
+                                        COL_DEP_TYPE, TYPE_RDEP,
+                                        COL_DEP_PARENT, package,
+                                        COL_DEP_PACKAGE, rdepend)
 
 
 class gtkthread(threading.Thread):
@@ -293,7 +293,7 @@  def main(server, eventHandler, params):
 
             if isinstance(event, bb.event.DepTreeGenerated):
                 gtk.gdk.threads_enter()
-                parse(event._depgraph, dep.pkg_model, dep.depends_model)
+                dep.parse(event._depgraph)
                 gtk.gdk.threads_leave()
 
             if isinstance(event, bb.command.CommandCompleted):