Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Private Attributes
ATContentTypes.lib.validators.TidyHtmlValidator Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 name
 title
 description

Static Private Attributes

 __implements__ = IValidator

Detailed Description

use mxTidy to check HTML

Fail on errors and warnings
Do not clean up the value

Definition at line 97 of file validators.py.


Constructor & Destructor Documentation

def ATContentTypes.lib.validators.TidyHtmlValidator.__init__ (   self,
  name,
  title = '',
  description = '' 
)

Definition at line 106 of file validators.py.

00106 
00107     def __init__(self, name, title='', description=''):
00108         self.name = name
00109         self.title = title or name
00110         self.description = description


Member Function Documentation

def ATContentTypes.lib.validators.TidyHtmlValidator.__call__ (   self,
  value,
  args,
  kw 
)

Definition at line 111 of file validators.py.

00111 
00112     def __call__(self, value, *args, **kw):
00113         if not (HAS_MX_TIDY and MX_TIDY_ENABLED):
00114             # no mxTidy installed
00115             return 1
00116 
00117         request = kw['REQUEST']
00118         field   = kw['field']
00119 
00120         result = doTidy(value, field, request)
00121         if result is None:
00122             return 1
00123 
00124         nerrors, nwarnings, outputdata, errordata = result
00125         errors = nerrors + nwarnings
00126 
00127         if errors:
00128             return ("Validation Failed(%s): \n %s" % (self.name, errordata))
00129         else:
00130             return 1
00131 
00132 validatorList.append(TidyHtmlValidator('isTidyHtml', title='', description=''))
00133 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 104 of file validators.py.

Definition at line 109 of file validators.py.

Definition at line 107 of file validators.py.

Definition at line 108 of file validators.py.


The documentation for this class was generated from the following file: