Commit daefa335 authored by 's avatar

- re-added 'extra' argument (someone was missing it)

parent 850a3626
...@@ -53,11 +53,12 @@ class Functional(sandbox.Sandboxed): ...@@ -53,11 +53,12 @@ class Functional(sandbox.Sandboxed):
implements(interfaces.IFunctional) implements(interfaces.IFunctional)
@savestate @savestate
def publish(self, path, basic=None, env=None, request_method='GET', def publish(self, path, basic=None, env=None, extra=None,
stdin=None, handle_errors=True): request_method='GET', stdin=None, handle_errors=True):
'''Publishes the object at 'path' returning a response object.''' '''Publishes the object at 'path' returning a response object.'''
from StringIO import StringIO from StringIO import StringIO
from ZPublisher.Request import Request
from ZPublisher.Response import Response from ZPublisher.Response import Response
from ZPublisher.Publish import publish_module from ZPublisher.Publish import publish_module
...@@ -66,6 +67,8 @@ class Functional(sandbox.Sandboxed): ...@@ -66,6 +67,8 @@ class Functional(sandbox.Sandboxed):
if env is None: if env is None:
env = {} env = {}
if extra is None:
extra = {}
request = self.app.REQUEST request = self.app.REQUEST
...@@ -89,12 +92,14 @@ class Functional(sandbox.Sandboxed): ...@@ -89,12 +92,14 @@ class Functional(sandbox.Sandboxed):
outstream = StringIO() outstream = StringIO()
response = Response(stdout=outstream, stderr=sys.stderr) response = Response(stdout=outstream, stderr=sys.stderr)
request = Request(stdin, env, response)
for k, v in extra.items():
request[k] = v
publish_module('Zope2', publish_module('Zope2',
response=response,
stdin=stdin,
environ=env,
debug=not handle_errors, debug=not handle_errors,
request=request,
response=response,
) )
return ResponseWrapper(response, outstream, path) return ResponseWrapper(response, outstream, path)
......
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