[node-patches] Change in ovirt-node[master]: widgets: Disable logging
fabiand at redhat.com
fabiand at redhat.com
Thu Jul 17 13:32:50 UTC 2014
Fabian Deutsch has uploaded a new change for review.
Change subject: widgets: Disable logging
......................................................................
widgets: Disable logging
The widgets are also quite mature by now, so we can disbale logging in
this core and often called module.
Change-Id: I5e74a0b628c2fce01af98e2bbb3860b6cee34c90
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/ui/widgets.py
1 file changed, 11 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/31/30231/1
diff --git a/src/ovirt/node/ui/widgets.py b/src/ovirt/node/ui/widgets.py
index 63c7b8d..e6c532e 100644
--- a/src/ovirt/node/ui/widgets.py
+++ b/src/ovirt/node/ui/widgets.py
@@ -28,6 +28,10 @@
LOGGER = log.getLogger(__name__)
+def _debug(msg):
+ pass
+ #LOGGER.debug(msg)
+
class SelectableText(urwid.Text):
"""A Text widget that can be selected to be highlighted
"""
@@ -126,7 +130,7 @@
def __handle_activate(self):
if self.multi:
is_checked = self.is_selected()
- LOGGER.debug("handling activate: %s" % is_checked)
+ _debug("handling activate: %s" % is_checked)
self.select(not is_checked)
self._emit('activate', self)
@@ -215,7 +219,7 @@
def selection(self, selection=None):
if selection:
for c in self.__items:
- LOGGER.debug("checking: %s" % c)
+ _debug("checking: %s" % c)
if self.multi and c._key in selection:
c.select(True)
selected = [w._key for w in self.__items if w.is_selected()]
@@ -329,7 +333,7 @@
item = PluginMenuEntry(title, plugin)
items.append(item)
else:
- LOGGER.debug("No UI page for plugin %s" % plugin)
+ _debug("No UI page for plugin %s" % plugin)
self.__walker = urwid.SimpleListWalker(items)
@@ -608,7 +612,7 @@
bkey = self._button_to_key[button]
if key == bkey:
button.set_state(True)
- LOGGER.debug("Selected option %s (%s)" % (key, button))
+ _debug("Selected option %s (%s)" % (key, button))
LOGGER.warning("Could not set selection '%s'" % key)
def set_text(self, txt):
@@ -737,18 +741,18 @@
def keypress(self, size, key):
new_pos = self.focus_position
delta = 0
- LOGGER.debug("tab key: %s" % key)
+ _debug("tab key: %s" % key)
if "tab" in key:
delta = 1
elif "shift tab" in key:
delta = -1
if delta:
- LOGGER.debug("Setting focus to: %s" % new_pos)
+ _debug("Setting focus to: %s" % new_pos)
while new_pos >= 0 and new_pos < len(self.contents):
new_pos += delta
new_pos = new_pos % len(self.contents)
if self.contents[new_pos][0].selectable():
self.focus_position = new_pos
break
- LOGGER.debug("Focus on: %s" % self.focus)
+ _debug("Focus on: %s" % self.focus)
return super(TabablePile, self).keypress(size, key)
--
To view, visit http://gerrit.ovirt.org/30231
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e74a0b628c2fce01af98e2bbb3860b6cee34c90
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
More information about the node-patches
mailing list