Changeset 1466
- Timestamp:
- 12/02/06 14:38:49
- Files:
-
- trunk/cherrypy/lib/tidy.py (modified) (3 diffs)
- trunk/cherrypy/test/test.py (modified) (1 diff)
- trunk/cherrypy/test/test_tidy.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/tidy.py
r1419 r1466 9 9 10 10 def tidy(temp_dir, tidy_path, strict_xml=False, errors_to_ignore=None, 11 indent=False, wrap=False ):11 indent=False, wrap=False, warnings=True): 12 12 """Run cherrypy.response through Tidy. 13 13 14 14 If either 'indent' or 'wrap' are specified, then response.body will be 15 set to the output of tidy. Otherwise, only errors will change the body. 15 set to the output of tidy. Otherwise, only errors (including warnings, 16 if warnings is True) will change the body. 16 17 17 18 Note that we use the standalone Tidy tool rather than the python … … 43 44 tidy_enc = '-' + tidy_enc 44 45 45 strict_xml = (" -xml", "")[bool(strict_xml)]46 strict_xml = ("", " -xml")[bool(strict_xml)] 46 47 47 48 if indent: 48 49 indent = ' -indent' 49 50 else: 50 inde x= ''51 indent = '' 51 52 52 53 if wrap is False: … … 67 68 new_errs = [] 68 69 for err in open(err_file, 'rb').read().splitlines(): 69 if (err.find('Warning') != -1 or err.find('Error') != -1): 70 if (err.find('Error') != -1 or 71 (warnings and err.find('Warning') != -1)): 70 72 ignore = 0 71 73 for err_ign in errors_to_ignore or []: trunk/cherrypy/test/test.py
r1460 r1466 363 363 'test_sessionauthenticate', 364 364 ## 'test_states', 365 'test_tidy', 365 366 'test_xmlrpc', 366 367 'test_wsgiapps',

