Commits

Lynn Rees committed a3c6eff

[svn]

  • Participants
  • Parent commits 01fd3af
  • Branches wsgiform
  • Tags svn.28

Comments (0)

Files changed (1)

File branches/0.3/wsgiform/validators.py

 import re, urllib
 from xml.dom.expatbuilder import parseString
 from HTMLParser import HTMLParser
-try:
-    from akismet import Akismet
-except ImportError: pass
+
 
 # Miscellaneous specialized regexes
 _patterns = {
 
 patterns = dict((k, re.compile(v)) for k, v in _patterns.iteritems()) 
 
+def composer(data, validators):
+    '''Validates against a sequence of validating functions.'''
+    for validator in validators:
+        if not validator(data): return False
+    return True
+
 def _validate(key, data):
     '''Validates data by key.'''
     if patterns[key].match(data): return True
 
 # User submissions
 
-def notmalice(data):
-    '''Validates data is free of certain potentially malicious content.'''
+def notmalicious(data):
+    '''Validates that data is free of certain potentially malicious content.'''
     return _validate('demalice', data)
 
-def iscommentspam(data):
-    try:
-        
-
 def isxml(data):
     '''Validates data is well-formed XML.'''
     try: