Jeff Hinrichs - DM&T wrote: > Can I hook a callback in to cherrypy like tg does in the startup.py? > > if startFoo not in cherrypy.server.on_start_server_list: > cherrypy.server.on_start_server_list.append(startFoo) > > if stopFoo not in cherrypy.server.on_stop_server_list: > cherrypy.server.on_stop_server_list.append(stopFoo) > > If I can, I was thinking of putting the hooks in the > start-ProjectName.py file just after > start_server(Root()) > > ?? > > I am building a reporting/monitoring mechanism and I'll be heavily > modifying scheduler.py, so I want to move a copy into my project and > refer to it as projectname.scheduler instead. Now I'm trying to > figure out how to mimic the tg code that handles autoreload. > > thanks, > > -- > Jeff Answering my own question for completeness:
Searching returned this message: http://groups.google.com/group/turbogears/browse_thread/thread/e7fe18aadf6979da/bd5e928755a45f67?lnk=gst&q=controllers+package%0D%0Acontrollers+package&rnum=15#bd5e928755a45f67 Specifically, "* The turbogears.startup now contains call_on_startup and call_on_shutdown lists. You can append callables to these to have them executed at the right time. " So, the lists turbogears.startup.call_on_startup and turbogears.startup.call_on_shutdown are your friends. -Jeff --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

