Make dblink._display_merge() detect scheduler presence internally.
authorZac Medico <zmedico@gentoo.org>
Wed, 16 Jul 2008 01:15:18 +0000 (01:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 16 Jul 2008 01:15:18 +0000 (01:15 -0000)
svn path=/main/trunk/; revision=11067

pym/portage/dbapi/vartree.py

index 49b7442a6aab38d92f363cddfb1dd6c97c752f75..724e00ef8ef66d492442f58d36c3eea86c3b83f8 100644 (file)
@@ -1740,6 +1740,11 @@ class dblink(object):
                return os.EX_OK
 
        def _display_merge(self, msg, level=0):
+               if self._scheduler is not None:
+                       self._scheduler.dblinkDisplayMerge(
+                               self.settings, msg, level=level)
+                       return
+
                if level >= logging.WARNING:
                        noiselevel = -1
                        msg_func = writemsg
@@ -1761,12 +1766,7 @@ class dblink(object):
                @rtype: None
                """
 
-               if self._scheduler is None:
-                       showMessage = self._display_merge
-               else:
-                       def showMessage(msg, level=0):
-                               self._scheduler.dblinkDisplayMerge(
-                                       self.settings, msg, level=level)
+               showMessage = self._display_merge
 
                if not pkgfiles:
                        showMessage("No package files given... Grabbing a set.\n")