summaryrefslogtreecommitdiff
path: root/src/zope/tales/engine.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/tales/engine.py')
-rw-r--r--src/zope/tales/engine.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/zope/tales/engine.py b/src/zope/tales/engine.py
new file mode 100644
index 0000000..4affe46
--- /dev/null
+++ b/src/zope/tales/engine.py
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Expression engine configuration and registration.
+
+Each expression engine can have its own expression types and base names.
+
+$Id$
+"""
+from zope.tales.tales import ExpressionEngine
+from zope.tales.expressions import PathExpr, StringExpr, NotExpr, DeferExpr
+from zope.tales.expressions import SimpleModuleImporter
+from zope.tales.pythonexpr import PythonExpr
+
+def Engine():
+ e = ExpressionEngine()
+ reg = e.registerType
+ for pt in PathExpr._default_type_names:
+ reg(pt, PathExpr)
+ reg('string', StringExpr)
+ reg('python', PythonExpr)
+ reg('not', NotExpr)
+ reg('defer', DeferExpr)
+ e.registerBaseName('modules', SimpleModuleImporter())
+ return e
+
+Engine = Engine()