ztfy/utils/site.py
branchZTK-1.1
changeset 71 2512d7fe2cda
parent 70 82d8de021806
child 73 96079b5bdc1f
equal deleted inserted replaced
70:82d8de021806 71:2512d7fe2cda
    22 
    22 
    23 # import local interfaces
    23 # import local interfaces
    24 from interfaces import INewSiteManagerEvent
    24 from interfaces import INewSiteManagerEvent
    25 
    25 
    26 # import Zope3 packages
    26 # import Zope3 packages
    27 from zope.app import zapi
    27 from zope.component import getUtility
    28 from zope.interface import implements
    28 from zope.interface import implements
    29 from zope.location import locate
    29 from zope.location import locate
    30 
    30 
    31 # import local packages
    31 # import local packages
    32 
    32 
    41 
    41 
    42 
    42 
    43 def locateAndRegister(contained, parent, key, intids=None):
    43 def locateAndRegister(contained, parent, key, intids=None):
    44     locate(contained, parent)
    44     locate(contained, parent)
    45     if intids is None:
    45     if intids is None:
    46         intids = zapi.getUtility(IIntIds)
    46         intids = getUtility(IIntIds)
    47     intids.register(contained)
    47     intids.register(contained)
    48     parent[key] = contained
    48     parent[key] = contained