Hello,
I am in a function that has no context and want to set a site.
The function is called periodically from a scheduler:

from scheduler import loop

def onStartup(event):
    refresher = loop.LoopTask(releaseRefreshEvent, interval=60)

In this function I need to call getUtilitiesFor which needs a site set but I 
don't know how to get a site:

(Pdb)  from zope.app.component import hooks
(Pdb) from zope.app.zapi import *

(Pdb) hooks.setSite(getSiteManager())
*** AttributeError: 'BaseGlobalComponents' object has no 
attribute 'getSiteManager'

(Pdb) hooks.setSite(getGlobalSiteManager())
*** AttributeError: 'BaseGlobalComponents' object has no 
attribute 'getSiteManager'

Just getting the root object (which AFAIK always is a site) would be ok. Or 
the object of static path.

Thanks,

Florian
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to