Home | Trees | Index | Help |
---|
|
1 ############################################################################## 2 # 3 # Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved. 4 # 5 # This software is subject to the provisions of the Zope Public License, 6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. 7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED 8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS 10 # FOR A PARTICULAR PURPOSE 11 # 12 ############################################################################## 13 """DTML Utilities 14 15 $Id: DT_Util.py 1007 2007-02-10 01:07:28Z stefan $""" 16 17 import re 18 import VSEval 19 20 str=__builtins__['str'] # Waaaaa, waaaaaaaa needed for pickling waaaaa 21 22 ParseError='Document Template Parse Error' 23 ValidationError='Unauthorized' 24 2526 -def html_quote(v, name='(Unknown name)', md={}, 27 character_entities=( 28 (('&'), '&'), 29 (('<'), '<' ), 30 (('>'), '>' ), 31 (('"'), '"'))): #"32 text=str(v) 33 for re,name in character_entities: 34 if text.find(re) >= 0: text=text.split(re).join(name) 35 return text
Home | Trees | Index | Help |
---|
Generated by Epydoc 3.0alpha2 on Fri Sep 28 01:00:42 2007 | http://epydoc.sf.net |