diff options
author | ianb <devnull@localhost> | 2005-08-22 20:51:44 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2005-08-22 20:51:44 +0000 |
commit | cd6db68f13e3d23ab2922c3430196a12fbf01b3d (patch) | |
tree | 0fe4bda5505034119aa1577ce430e7b6822d150d /paste/cgiapp.py | |
parent | 9ed8f79838ba500832944614ed6978a0770dcd11 (diff) | |
download | paste-cd6db68f13e3d23ab2922c3430196a12fbf01b3d.tar.gz |
Converted cgiapp to paste.deploy
Diffstat (limited to 'paste/cgiapp.py')
-rw-r--r-- | paste/cgiapp.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/paste/cgiapp.py b/paste/cgiapp.py index ff98452..b1f1077 100644 --- a/paste/cgiapp.py +++ b/paste/cgiapp.py @@ -4,6 +4,7 @@ Application that runs a CGI script. import os import subprocess import select +from paste.deploy import converters __all__ = ['CGIError', 'CGIApplication'] @@ -19,15 +20,18 @@ class CGIApplication(object): a path, then ``$PATH`` will be used. """ - def __init__(self, script, path=None, + def __init__(self, global_conf, + script, + path=None, include_os_environ=True, query_string=None): self.script_filename = script - if isinstance(path, (str, unicode)): - path = [path] + if path is None: + path = (global_conf.get('path') + or global_conf.get('PATH')) if path is None: path = os.environ.get('PATH', '').split(':') - self.path = path + self.path = converters.aslist(path, ':') if '?' in script: assert query_string is None, ( "You cannot have '?' in your script name (%r) and also " @@ -45,7 +49,7 @@ class CGIApplication(object): % (script, self.path)) else: self.script = script - self.include_os_environ = include_os_environ + self.include_os_environ = converters.asbool(include_os_environ) self.query_string = query_string def __call__(self, environ, start_response): |