示例#1
0
文件: slotexpr.py 项目: goschtl/zope
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)
示例#2
0
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)
示例#3
0
文件: __init__.py 项目: eea/zptlint
def registerTALESExpressionType(name, handler):
    Engine.registerType(name, handler)
示例#4
0
def register(name, handler):
    """Register tales expression type."""
    Engine.registerType(name, handler)
示例#5
0
文件: __init__.py 项目: jean/zptlint
def registerTALESExpressionType(name, handler):
    Engine.registerType(name, handler)