diff src/browser/base_widget.py @ 458:1eeed8028199

browser side: rename parameter of getParent / getWidgetPanel from 'verbose' to 'expect'
author souliane <souliane@mailoo.org>
date Thu, 29 May 2014 17:49:59 +0200
parents 981ed669d3b3
children
line wrap: on
line diff
--- a/src/browser/base_widget.py	Thu May 29 17:32:32 2014 +0200
+++ b/src/browser/base_widget.py	Thu May 29 17:49:59 2014 +0200
@@ -224,14 +224,16 @@
     def getDebugName(self):
         return "%s (%s)" % (self, self.__title.getText())
 
-    def getWidgetsPanel(self, verbose=True):
-        return self.getParent(WidgetsPanel, verbose)
+    def getWidgetsPanel(self, expect=True):
+        return self.getParent(WidgetsPanel, expect)
 
-    def getParent(self, class_=None, verbose=True):
-        """
+    def getParent(self, class_=None, expect=True):
+        """Return the closest ancestor of the specified class.
+
         Note: this method overrides pyjamas.ui.Widget.getParent
+
         @param class_: class of the ancestor to look for or None to return the first parent
-        @param verbose: set to True to log error messages # FIXME: must be removed
+        @param expect: set to True if the parent is expected (print a message if not found)
         @return: the parent/ancestor or None if it has not been found
         """
         current = Widget.getParent(self)
@@ -239,7 +241,7 @@
             return current  # this is the default behavior
         while current is not None and not isinstance(current, class_):
             current = Widget.getParent(current)
-        if current is None and verbose:
+        if current is None and expect:
             log.debug("Can't find parent %s for %s" % (class_, self))
         return current