Fix last remaining Five test failure by providing the ZPT traverser

(boboTraverseAwareSimpleTraverse) with a request. Since zope.app has
already solved this problem (and I copied zope.app's approach in the
traverser), we can just simply reuse zope.app's code here. Yes, it
adds another dependency on zope.app, but at least we're not duplicating
code.

All Zope 2 tests should be passing now...
parent d5b4fc98
...@@ -18,7 +18,7 @@ for Python expressions, string literals, and paths. ...@@ -18,7 +18,7 @@ for Python expressions, string literals, and paths.
$Id$ $Id$
""" """
from zope.interface import implements from zope.interface import implements
from zope.tales.tales import ExpressionEngine, Context, Iterator from zope.tales.tales import Context, Iterator
from zope.tales.expressions import PathExpr, StringExpr, NotExpr from zope.tales.expressions import PathExpr, StringExpr, NotExpr
from zope.tales.expressions import DeferExpr, SubPathExpr from zope.tales.expressions import DeferExpr, SubPathExpr
from zope.tales.pythonexpr import PythonExpr from zope.tales.pythonexpr import PythonExpr
...@@ -26,6 +26,7 @@ from zope.traversing.interfaces import ITraversable ...@@ -26,6 +26,7 @@ from zope.traversing.interfaces import ITraversable
from zope.traversing.adapters import traversePathElement from zope.traversing.adapters import traversePathElement
from zope.contentprovider.tales import TALESProviderExpression from zope.contentprovider.tales import TALESProviderExpression
from zope.proxy import removeAllProxies from zope.proxy import removeAllProxies
import zope.app.pagetemplate.engine
import OFS.interfaces import OFS.interfaces
from Acquisition import aq_base from Acquisition import aq_base
...@@ -133,15 +134,9 @@ class ZopeContext(Context): ...@@ -133,15 +134,9 @@ class ZopeContext(Context):
domain, msgid, mapping=mapping, domain, msgid, mapping=mapping,
context=context, default=default) context=context, default=default)
class ZopeEngine(ExpressionEngine): class ZopeEngine(zope.app.pagetemplate.engine.ZopeEngine):
def getContext(self, contexts=None, **kwcontexts): _create_context = ZopeContext
if contexts is not None:
if kwcontexts:
kwcontexts.update(contexts)
else:
kwcontexts = contexts
return ZopeContext(self, kwcontexts)
class ZopeIterator(Iterator): class ZopeIterator(Iterator):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment