Back to index

python-weblib  1.3.9
Classes | Functions | Variables
pyweblib.forms Namespace Reference

Classes

class  Field
class  Textarea
class  Input
class  HiddenInput
class  File
class  Password
class  Radio
class  Select
class  Checkbox
class  Keygen
class  FormException
class  InvalidRequestMethod
class  InvalidFormEncoding
class  ContentLengthExceeded
class  UndeclaredFieldName
class  ParamsMissing
class  InvalidValueFormat
class  InvalidValueLen
class  TooManyValues
class  Form

Functions

def escapeHTML

Variables

string __version__ = '0.16.0'

Detailed Description

pyweblib.forms - class library for handling <FORM> input
(c) by Michael Stroeder <michael@stroeder.com>

This module is distributed under the terms of the
GPL (GNU GENERAL PUBLIC LICENSE) Version 2
(see http://www.gnu.org/copyleft/gpl.html)

Python compability note:
This module only works with Python 2.0 since all string parameters
are assumed to be Unicode objects and string methods are used instead
string module.

$Id: forms.py,v 1.47 2012/03/16 13:09:48 michael Exp $

Function Documentation

Escape all characters with a special meaning in HTML
to appropriate character tags

Definition at line 22 of file forms.py.

00022 
00023 def escapeHTML(s):
00024   """
00025   Escape all characters with a special meaning in HTML
00026   to appropriate character tags
00027   """
00028   s = s.replace('&','&#38;')
00029   s = s.replace('<','&#60;')
00030   s = s.replace('>','&#62;')
00031   s = s.replace("'",'&#39;')
00032   s = s.replace('"','&#34;')
00033   s = s.replace(':','&#58;')
00034   s = s.replace('=','&#61;')
00035   s = s.replace('{','&#123;')
00036   s = s.replace('}','&#125;')
00037   s = s.replace('(','&#40;')
00038   s = s.replace(')','&#41;')
00039   s = s.replace('`','&#96;')
00040   return s
00041 

Here is the caller graph for this function:


Variable Documentation

string pyweblib.forms.__version__ = '0.16.0'

Definition at line 17 of file forms.py.