1.1 --- a/WebStack/Adapters/CGI.py Sat May 29 19:32:48 2004 +0000
1.2 +++ b/WebStack/Adapters/CGI.py Sat May 29 19:33:09 2004 +0000
1.3 @@ -7,14 +7,19 @@
1.4 import WebStack.CGI
1.5 import sys, os
1.6
1.7 -def respond(resource, authenticator=None):
1.8 +def respond(resource, authenticator=None, input=None, output=None, env=None):
1.9
1.10 """
1.11 Dispatch to the root application-specific 'resource'. Employ the optional
1.12 - 'authenticator' to control access to the resource.
1.13 + 'authenticator' to control access to the resource. If the optional 'input'
1.14 + stream, 'output' stream or environment 'env' are specified, use them instead
1.15 + of the defaults: standard input, standard output and the operating system
1.16 + environment respectively. Note that 'env' must evaluate to true for it to
1.17 + replace the default.
1.18 """
1.19
1.20 - trans = WebStack.CGI.Transaction(sys.stdin, sys.stdout, os.environ)
1.21 + trans = WebStack.CGI.Transaction(input or sys.stdin, output or sys.stdout,
1.22 + env or os.environ)
1.23
1.24 try:
1.25 if authenticator is None or authenticator.authenticate(trans):