def registerSlotExprType(): # Register the 'slot:' expression type. # Register with Products.PageTemplates. try: from Products.PageTemplates.Expressions import getEngine except ImportError: log.exception("Unable to register the slot expression type") else: engine = getEngine() if not engine.getTypes().has_key('slot'): engine.registerType('slot', SlotExpr) # Register with zope.tales. try: from zope.tales.engine import Engine except ImportError: log.exception("Unable to register the slot expression type") else: if not Engine.getTypes().has_key('slot'): Engine.registerType('slot', SlotExpr)
def registerTALESExpressionType(name, handler): Engine.registerType(name, handler)
def register(name, handler): """Register tales expression type.""" Engine.registerType(name, handler)