[Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Sebastian Bartos
Hi folks, I'm struggling with some Zope 3 startup code. I registered a user like this for the Session Credentials plugin and login form stuff: ... def create(self, data): site = getSite() sm = site.getSiteManager() if sm.has_key('auth'): return "Site is a

Re: [Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Thierry Florac
Le jeudi 12 février 2009 à 17:50 +0100, Sebastian Bartos a écrit : > I'm struggling with some Zope 3 startup code. I registered a user like > this for the Session Credentials plugin and login form stuff: > > ... > > def create(self, data): > site = getSite() > sm = site.getSit

Re: [Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Dan Korostelev
2009/2/12 Thierry Florac : > Le jeudi 12 février 2009 à 17:50 +0100, Sebastian Bartos a écrit : >> I'm struggling with some Zope 3 startup code. I registered a user like >> this for the Session Credentials plugin and login form stuff: >> >> ... >> >> def create(self, data): >> site = ge

Re: [Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Sebastian Bartos
Was playing with the event system a bit, and ended up with the following, which works fine: import zope.event class MyEvent: pass event = MyEvent() def f(event): if isinstance(event, zope.app.appsetup.interfaces.ProcessStarting): """Put stuff you want to execute after server startu

Re: [Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Marius Gedminas
On Thu, Feb 12, 2009 at 07:28:23PM +0100, Sebastian Bartos wrote: > Was playing with the event system a bit, and ended up with the > following, which works fine: > > import zope.event > class MyEvent: > pass > event = MyEvent() > def f(event): > if isinstance(event, zope.app.appsetup.inter