# HG changeset patch # User souliane # Date 1401378599 -7200 # Node ID 1eeed802819919146a1fb45e15c8c842c0456eca # Parent b55bc50756fa90829833b58a6887ffc01750ba98 browser side: rename parameter of getParent / getWidgetPanel from 'verbose' to 'expect' diff -r b55bc50756fa -r 1eeed8028199 src/browser/base_widget.py --- 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 diff -r b55bc50756fa -r 1eeed8028199 src/browser/libervia_main.py --- a/src/browser/libervia_main.py Thu May 29 17:32:32 2014 +0200 +++ b/src/browser/libervia_main.py Thu May 29 17:49:59 2014 +0200 @@ -622,7 +622,7 @@ @return: the existing widget that has been found or None.""" selected_tab = self.tab_panel.getCurrentPanel() for lib_wid in self.libervia_widgets: - parent = lib_wid.getWidgetsPanel(verbose=False) + parent = lib_wid.getWidgetsPanel(expect=False) if parent is None or (ignoreOtherTabs and parent != selected_tab): # do not return a widget that is not in the currently selected tab continue @@ -658,7 +658,7 @@ else: tab = self.addTab(new_tab, lib_wid, False) else: # reuse existing widget - tab = lib_wid.getWidgetsPanel(verbose=False) + tab = lib_wid.getWidgetsPanel(expect=False) if new_tab is None: if tab is not None: tab.removeWidget(lib_wid)