Thanks, Marco; glad you like it. I think it would be a good idea to
package this up a little better for distribution, and then, in theory,
people could do:
import flash2
flash2.info('Yadda yadda')
...and it would just work by binding to the request like you suggest.
Ansel
On Jun 12, 8:10 am, Marco Mariani <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] ha scritto:
>
> > That's an interesting suggestion. I'm not a CherryPy expert, so how
> > do I bind something to a request like that?
>
> This way:
>
> >>> def get_flash_service():
> >>> try:
> >>> ret = cherrypy.request.flash_service
> >>> except AttributeError:
> >>> ret = cherrypy.request.flash_service = Flash()
> >>> return ret
>
> >>> def info(*args, **kw):
> >>> get_flash_service().info(*args, **kw)
>
> I use this method to attach any kind of object to the request (even
> short-lived db or ldap connections)
>
> I've already switched to your class and it's cute :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---