commit adb85696f14d412c5b3ec9cde65bdd81e161c5dc
Author: Jan Pokorny <jpokorny(a)redhat.com>
Date: Mon Aug 23 16:37:58 2010 +0200
Re: Fix rhbz#536841: forgotten logging
luci/lib/flash2.py | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/luci/lib/flash2.py b/luci/lib/flash2.py
index 777c58f..a0d2772 100644
--- a/luci/lib/flash2.py
+++ b/luci/lib/flash2.py
@@ -5,12 +5,9 @@
from tg import session
from paste.registry import StackedObjectProxy
-import logging
-log = logging.getLogger(__name__)
-
-
__all__ = ['Flash2', 'flash2']
+
class _Flash2Message(object):
def __init__(self, msg, cls='info', html=False, hideable=False):
self.message = msg
@@ -55,7 +52,7 @@ class Flash2:
Note the same can be achieved by:
flash2.info('This is info.').warning('This is warning').flush()
- As shown, you have always use 'flush' method in order to store the state
+ As shown, you always have to use 'flush' method in order to store the state
of flash messages to session's data which are read on the templates side
afterwards and displayed on respective page. During (the first) iteration
over the instance of this class, all messages are consequently popped
@@ -64,7 +61,6 @@ class Flash2:
"""
def __init__(self):
- log.info("Creating _Flash2, id = %d" % id(self))
self.__messages = []
#self.__messages_dict = {'info':[], 'warning':[],
'error':[], 'ok': []}
@@ -83,9 +79,6 @@ class Flash2:
raise StopIteration
return DeletingIterator(self.__messages)
- def __del__(self):
- log.info("Deleting _Flash2, id = %d", id(self))
-
def __repr__(self):
return "<Flash2 with messages: %s>" % ",
".join(map(lambda m: str(m), self.get_messages()))
Show replies by date