rendered paste bodyfrom StringIO import StringIOfrom Products.CMFCore.utils import getToolByNamefrom Products.Archetypes import listTypesfrom Products.Archetypes.Extensions.utils import installTypes, install_subskinfrom Products.Escola.config import GLOBALS, PROJECTNAME def install(self): out = StringIO() print >> out, "Installing Escola" # Install types classes = listTypes(PROJECTNAME) installTypes(self, out, classes, PROJECTNAME) print >> out, "Installed types" # Install skin install_subskin(self, out, GLOBALS) print >> out, "Installed subskin" # Register types with portal_factory factory = getToolByName(self, 'portal_factory') types = factory.getFactoryTypes().keys() if 'Escola' not in types: types.append('Escola') factory.manage_setPortalFactoryTypes(listOfTypeIds = types) print >> out, "Added Escola to portal_factory" return out.getvalue()