def check_utilities(sm, master, errors): for one in sm.utilities._subscribers: for interface in one.keys(): try: for util_tup in getUtilitiesFor(interface, context=master): utility = util_tup[1] _checkAttributes(utility, errors, context=master) except TypeError, msg: error("Cannot get utilities for interface '%s' : %s"%(str(interface), msg)) # check site utilities if master.meta_type == 'Plone Site': from Products.CMFCore.PortalObject import PortalObjectBase sm = PortalObjectBase.getSiteManager(master) check_utilities(sm, master, errors) if master.__class__ == Application: sm = getSiteManager() check_utilities(sm, master, errors) for oid in master.objectIds(): try: obj = getattr(master, oid) trace('%s->%s' % ('/'.join(master.getPhysicalPath()), obj.getId())) #output.append('%s->%s' % ('/'.join(master.getPhysicalPath()), obj.getId())) if hasattr(obj, 'objectIds') and obj.getId() != 'Control_Panel': _sub(obj, errors) # check catalog explicitly