summaryrefslogtreecommitdiff
path: root/paste/wdg_validate.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-08-22 22:19:11 +0000
committerianb <devnull@localhost>2005-08-22 22:19:11 +0000
commitc7f7691219009cfae6305b3cf7db28b069be81de (patch)
treebc9b5d452d08b6d460fca9fc952d3756be36d847 /paste/wdg_validate.py
parent37599d8703e35cebcf8d13bf617d4174c4d78e23 (diff)
downloadpaste-c7f7691219009cfae6305b3cf7db28b069be81de.tar.gz
paste.deployified wdg_validate
Diffstat (limited to 'paste/wdg_validate.py')
-rw-r--r--paste/wdg_validate.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/paste/wdg_validate.py b/paste/wdg_validate.py
index 7f16810..e2dfacf 100644
--- a/paste/wdg_validate.py
+++ b/paste/wdg_validate.py
@@ -30,15 +30,11 @@ class WDGValidateMiddleware(object):
middleware.append('paste.wdg_validate.WDGValidateMiddleware')
"""
- _config_wdg_path = metadata.Config(
- """
- The path to the ``validate`` executable. ($PATH will be searched)
- """, default='validate')
-
_end_body_regex = re.compile(r'</body>', re.I)
- def __init__(self, app):
+ def __init__(self, app, global_conf=None, wdg_path='validate'):
self.app = app
+ self.wdg_path = wdg_path
def __call__(self, environ, start_response):
output = StringIO()
@@ -68,9 +64,8 @@ class WDGValidateMiddleware(object):
if v.startswith('text/xhtml+xml'):
ops.append('--xml')
# @@: Should capture encoding too
- conf = environ['paste.config']
html_errors = self.call_wdg_validate(
- conf.get('wdg_path', 'validate'), ops, page)
+ self.wdg_path, ops, page)
if not html_errors:
return [page]
return self.add_error(page, html_errors)