Skip to content
Browse files

Spelling and whitespace clean-up.

  • Loading branch information...
1 parent 26c3ea9 commit d5d24cf4eccd620fcea0466d05bb807e4fb44e05 @Cito Cito committed Aug 31, 2011
Showing with 20 additions and 9 deletions.
  1. +20 −9 tg/flash.py
View
29 tg/flash.py
@@ -1,14 +1,17 @@
-"""Flash messaging system for sending info to the user in a
-non-obtrusive way
"""
+Flash messaging system for sending info to the user in a non-obtrusive way
+"""
+
from webflash import Flash
from pylons import response, request
from logging import getLogger
log = getLogger(__name__)
+
class TGFlash(Flash):
+
def __call__(self, message, status=None, **extra_payload):
# Force the message to be unicode so lazystrings, etc... are coerced
result = super(TGFlash, self).__call__(
@@ -25,21 +28,29 @@ def message(self):
@property
def status(self):
return self.pop_payload().get('status') or self.default_status
-
+
+
flash = TGFlash(
get_response=lambda: response,
get_request=lambda: request
)
+
#TODO: Deprecate these?
+
def get_flash():
- """Returns the message previously set by calling flash()
-
- Additonally removes the old flash message """
+ """Get the message previously set by calling flash().
+
+ Additionally removes the old flash message.
+
+ """
return flash.message
+
def get_status():
- """Returns the status of the last flash messagese
-
- Additonally removes the old flash message status"""
+ """Get the status of the last flash message.
+
+ Additionally removes the old flash message status.
+
+ """
return flash.status

0 comments on commit d5d24cf

Please sign in to comment.
Something went wrong with that request. Please try again.