From: archipelagosvk <svn...@pl...> - 2006-04-30 21:49:44
|
Author: archipelagosvk Date: Sun Apr 30 21:49:30 2006 New Revision: 22863 Added: plone.portlets/trunk/Extensions/ plone.portlets/trunk/Extensions/Install.py (contents, props changed) Modified: / (props changed) Log: r23071@archipelago: elvix | 2006-04-28 22:33:55 +0200 add installer for utility Added: plone.portlets/trunk/Extensions/Install.py ============================================================================== --- (empty file) +++ plone.portlets/trunk/Extensions/Install.py Sun Apr 30 21:49:30 2006 @@ -0,0 +1,23 @@ +from zope.app.component.hooks import setSite +from zope.app import zapi +from Products.Five.site.localsite import enableLocalSiteHook + +from Products.portlets.interfaces import IPortletAssigments + + +def install(self): + """Install the Plone stuff """ + + out = StringIO() + setupUtility(self, out) + +def setupUtility(self, out): + """set up te local utility""" + app = self + # If we have the zope Application and the utility is not yet registered, + # then register it. + if (app is not None and zapi.queryUtility(IPortletAssigments, default=None, context=self) is None): + enableLocalSiteHook(app) + setSite(app) + sm = app.getSiteManager() + sm.registerUtility(IPortletAssigments, PortletAssigments()) \ No newline at end of file |