<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>web2py.gluon.html</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="web2py.gluon-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
Package web2py ::
<a href="web2py.gluon-module.html">Package gluon</a> ::
Module html
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="web2py.gluon.html-module.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module html</h1><span class="codelink"><a href="web2py.gluon.html-pysrc.html">source code</a></span><br /><br />
This file is part of the web2py Web Framework Copyrighted by Massimo
Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3
(http://www.gnu.org/licenses/lgpl.html)<br /><br />
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Classes</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Classes"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.XmlComponent-class.html" class="summary-name">XmlComponent</a><br />
Abstract root for all Html components
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.XML-class.html" class="summary-name">XML</a><br />
use it to wrap a string that contains XML/HTML so that it will
not be escaped by the template
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.DIV-class.html" class="summary-name">DIV</a><br />
HTML helper, for easy generating and manipulating a DOM
structure.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.CAT-class.html" class="summary-name">CAT</a>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.__TAG__-class.html" class="summary-name">__TAG__</a><br />
TAG factory example:
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.HTML-class.html" class="summary-name">HTML</a><br />
There are four predefined document type definitions.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.XHTML-class.html" class="summary-name">XHTML</a><br />
This is XHTML version of the HTML helper.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.HEAD-class.html" class="summary-name">HEAD</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TITLE-class.html" class="summary-name">TITLE</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.META-class.html" class="summary-name">META</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.LINK-class.html" class="summary-name">LINK</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.SCRIPT-class.html" class="summary-name">SCRIPT</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.STYLE-class.html" class="summary-name">STYLE</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.IMG-class.html" class="summary-name">IMG</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.SPAN-class.html" class="summary-name">SPAN</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.BODY-class.html" class="summary-name">BODY</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.H1-class.html" class="summary-name">H1</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.H2-class.html" class="summary-name">H2</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.H3-class.html" class="summary-name">H3</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.H4-class.html" class="summary-name">H4</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.H5-class.html" class="summary-name">H5</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.H6-class.html" class="summary-name">H6</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.P-class.html" class="summary-name">P</a><br />
Will replace ``\n`` by ``<br />`` if the `cr2br` attribute
is provided.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.B-class.html" class="summary-name">B</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.BR-class.html" class="summary-name">BR</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.HR-class.html" class="summary-name">HR</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.A-class.html" class="summary-name">A</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.BUTTON-class.html" class="summary-name">BUTTON</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.EM-class.html" class="summary-name">EM</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.EMBED-class.html" class="summary-name">EMBED</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TT-class.html" class="summary-name">TT</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.PRE-class.html" class="summary-name">PRE</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.CENTER-class.html" class="summary-name">CENTER</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.CODE-class.html" class="summary-name">CODE</a><br />
displays code in HTML with syntax highlighting.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.LABEL-class.html" class="summary-name">LABEL</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.LI-class.html" class="summary-name">LI</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.UL-class.html" class="summary-name">UL</a><br />
UL Component.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.OL-class.html" class="summary-name">OL</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TD-class.html" class="summary-name">TD</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TH-class.html" class="summary-name">TH</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TR-class.html" class="summary-name">TR</a><br />
TR Component.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.THEAD-class.html" class="summary-name">THEAD</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TBODY-class.html" class="summary-name">TBODY</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TFOOT-class.html" class="summary-name">TFOOT</a>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.COL-class.html" class="summary-name">COL</a>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.COLGROUP-class.html" class="summary-name">COLGROUP</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TABLE-class.html" class="summary-name">TABLE</a><br />
TABLE Component.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.I-class.html" class="summary-name">I</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.IFRAME-class.html" class="summary-name">IFRAME</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.INPUT-class.html" class="summary-name">INPUT</a><br />
INPUT Component
examples::
>>> INPUT(_type='text', _name='name', value='Max').xml()
'<input name="name" type="text" value="Max" />'
>>> INPUT(_type='checkbox', _name='checkbox', value='on').xml()
'<input checked="checked" name="checkbox" type="checkbox" value="on" />'
>>> INPUT(_type='radio', _name='radio', _value='yes', value='yes').xml()
'<input checked="checked" name="radio" type="radio" value="yes" />'
>>> INPUT(_type='radio', _name='radio', _value='no', value='yes').xml()
'<input name="radio" type="radio" value="no" />'
the input helper takes two special attributes value= and requires=.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.TEXTAREA-class.html" class="summary-name">TEXTAREA</a><br />
example:
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.OPTION-class.html" class="summary-name">OPTION</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.OBJECT-class.html" class="summary-name">OBJECT</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.OPTGROUP-class.html" class="summary-name">OPTGROUP</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.SELECT-class.html" class="summary-name">SELECT</a><br />
example:
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.FIELDSET-class.html" class="summary-name">FIELDSET</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.LEGEND-class.html" class="summary-name">LEGEND</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.FORM-class.html" class="summary-name">FORM</a><br />
example:
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.BEAUTIFY-class.html" class="summary-name">BEAUTIFY</a><br />
example::
>>> BEAUTIFY(['a', 'b', {'hello': 'world'}]).xml()
'<div><table><tr><td><div>a</div></td></tr><tr><td><div>b</div></td></tr><tr><td><div><table><tr><td style="font-weight:bold;">hello</td><td valign="top">:</td><td><div>world</div></td></tr></table></div></td></tr></table></div>'
turns any list, dictionary, etc into decent looking html.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.MENU-class.html" class="summary-name">MENU</a><br />
Used to build menus...
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.web2pyHTMLParser-class.html" class="summary-name">web2pyHTMLParser</a><br />
obj = web2pyHTMLParser(text) parses and html/xml text into
web2py helpers.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="web2py.gluon.html.MARKMIN-class.html" class="summary-name">MARKMIN</a><br />
For documentation:
http://web2py.com/examples/static/markmin.html
</td>
</tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Functions</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Functions"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.html-module.html#join" class="summary-sig-name">join</a>(<span class="summary-sig-arg">S</span>,
<span class="summary-sig-arg">sequence</span>)</span><br />
Return a string which is the concatenation of the strings in the
sequence.</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#join">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.html-module.html#xmlescape" class="summary-sig-name">xmlescape</a>(<span class="summary-sig-arg">data</span>,
<span class="summary-sig-arg">quote</span>=<span class="summary-sig-default">True</span>)</span><br />
returns an escaped string of the provided data</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#xmlescape">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.html-module.html#URL" class="summary-sig-name">URL</a>(<span class="summary-sig-arg">a</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">c</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">f</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">r</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">args</span>=<span class="summary-sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>,
<span class="summary-sig-arg">vars</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
<span class="summary-sig-arg">anchor</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
<span class="summary-sig-arg">extension</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">env</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">hmac_key</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">hash_vars</span>=<span class="summary-sig-default">True</span>,
<span class="summary-sig-arg">salt</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">user_signature</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">scheme</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">host</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">port</span>=<span class="summary-sig-default">1</span>)</span><br />
generate a URL
example::
>>> str(URL(a='a', c='c', f='f', args=['x', 'y', 'z'],
...</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#URL">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.html-module.html#verifyURL" class="summary-sig-name">verifyURL</a>(<span class="summary-sig-arg">request</span>,
<span class="summary-sig-arg">hmac_key</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">hash_vars</span>=<span class="summary-sig-default">True</span>,
<span class="summary-sig-arg">salt</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">user_signature</span>=<span class="summary-sig-default">1</span>)</span><br />
Verifies that a request's args & vars have not been tampered with by the user
:param request: web2py's request object
:param hmac_key: the key to authenticate with, must be the same one previously
used when calling URL()
:param hash_vars: which vars to include in our hashing.</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#verifyURL">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="XML_unpickle"></a><span class="summary-sig-name">XML_unpickle</span>(<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#XML_unpickle">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="XML_pickle"></a><span class="summary-sig-name">XML_pickle</span>(<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#XML_pickle">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="TAG_unpickler"></a><span class="summary-sig-name">TAG_unpickler</span>(<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#TAG_unpickler">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="TAG_pickler"></a><span class="summary-sig-name">TAG_pickler</span>(<span class="summary-sig-arg">data</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#TAG_pickler">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.html-module.html#embed64" class="summary-sig-name">embed64</a>(<span class="summary-sig-arg">filename</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">file</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">data</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">extension</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">image/gif</code><code class="variable-quote">'</code></span>)</span><br />
helper to encode the provided (binary) data into base64.</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#embed64">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="web2py.gluon.html-module.html#test" class="summary-sig-name">test</a>()</span><br />
Example:</td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#test">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="markdown_serializer"></a><span class="summary-sig-name">markdown_serializer</span>(<span class="summary-sig-arg">text</span>,
<span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">attr</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#markdown_serializer">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="markmin_serializer"></a><span class="summary-sig-name">markmin_serializer</span>(<span class="summary-sig-arg">text</span>,
<span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">1</span>,
<span class="summary-sig-arg">attr</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="web2py.gluon.html-pysrc.html#markmin_serializer">source code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Variables</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Variables"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="regex_crlf"></a><span class="summary-name">regex_crlf</span> = <code title="re.compile(r'[\r\n]')">re.compile(r'<code class="re-group">[</code>\r\n<code class="re-group">]</code>')</code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="ON"></a><span class="summary-name">ON</span> = <code title="True">True</code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="TAG"></a><span class="summary-name">TAG</span> = <code title="__TAG__()">__TAG__()</code>
</td>
</tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Function Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-FunctionDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="join"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">join</span>(<span class="sig-arg">S</span>,
<span class="sig-arg">sequence</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.html-pysrc.html#join">source code</a></span>
</td>
</table>
Return a string which is the concatenation of the strings in the
sequence. The separator between elements is S.
<dl class="fields">
<dt>Returns:</dt>
<dd><pre class="literalblock">
string
</pre></dd>
</dl>
</td></tr></table>
</div>
<a name="xmlescape"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">xmlescape</span>(<span class="sig-arg">data</span>,
<span class="sig-arg">quote</span>=<span class="sig-default">True</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.html-pysrc.html#xmlescape">source code</a></span>
</td>
</table>
<p>returns an escaped string of the provided data</p>
:param data: the data to be escaped :param quote: optional (default
False)
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="URL"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">URL</span>(<span class="sig-arg">a</span>=<span class="sig-default">1</span>,
<span class="sig-arg">c</span>=<span class="sig-default">1</span>,
<span class="sig-arg">f</span>=<span class="sig-default">1</span>,
<span class="sig-arg">r</span>=<span class="sig-default">1</span>,
<span class="sig-arg">args</span>=<span class="sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>,
<span class="sig-arg">vars</span>=<span class="sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
<span class="sig-arg">anchor</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
<span class="sig-arg">extension</span>=<span class="sig-default">1</span>,
<span class="sig-arg">env</span>=<span class="sig-default">1</span>,
<span class="sig-arg">hmac_key</span>=<span class="sig-default">1</span>,
<span class="sig-arg">hash_vars</span>=<span class="sig-default">True</span>,
<span class="sig-arg">salt</span>=<span class="sig-default">1</span>,
<span class="sig-arg">user_signature</span>=<span class="sig-default">1</span>,
<span class="sig-arg">scheme</span>=<span class="sig-default">1</span>,
<span class="sig-arg">host</span>=<span class="sig-default">1</span>,
<span class="sig-arg">port</span>=<span class="sig-default">1</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.html-pysrc.html#URL">source code</a></span>
</td>
</table>
<pre class="literalblock">
generate a URL
example::
>>> str(URL(a='a', c='c', f='f', args=['x', 'y', 'z'],
... vars={'p':1, 'q':2}, anchor='1'))
'/a/c/f/x/y/z?p=1&q=2#1'
>>> str(URL(a='a', c='c', f='f', args=['x', 'y', 'z'],
... vars={'p':(1,3), 'q':2}, anchor='1'))
'/a/c/f/x/y/z?p=1&p=3&q=2#1'
>>> str(URL(a='a', c='c', f='f', args=['x', 'y', 'z'],
... vars={'p':(3,1), 'q':2}, anchor='1'))
'/a/c/f/x/y/z?p=3&p=1&q=2#1'
>>> str(URL(a='a', c='c', f='f', anchor='1+2'))
'/a/c/f#1%2B2'
>>> str(URL(a='a', c='c', f='f', args=['x', 'y', 'z'],
... vars={'p':(1,3), 'q':2}, anchor='1', hmac_key='key'))
'/a/c/f/x/y/z?p=1&p=3&q=2&_signature=5d06bb8a4a6093dd325da2ee591c35c61afbd3c6#1'
generates a url '/a/c/f' corresponding to application a, controller c
and function f. If r=request is passed, a, c, f are set, respectively,
to r.application, r.controller, r.function.
The more typical usage is:
URL(r=request, f='index') that generates a url for the index function
within the present application and controller.
:param a: application (default to current if r is given)
:param c: controller (default to current if r is given)
:param f: function (default to current if r is given)
:param r: request (optional)
:param args: any arguments (optional)
:param vars: any variables (optional)
:param anchor: anchorname, without # (optional)
:param hmac_key: key to use when generating hmac signature (optional)
:param hash_vars: which of the vars to include in our hmac signature
True (default) - hash all vars, False - hash none of the vars,
iterable - hash only the included vars ['key1','key2']
:param scheme: URI scheme (True, 'http' or 'https', etc); forces absolute URL (optional)
:param host: string to force absolute URL with host (True means http_host)
:param port: optional port number (forces absolute URL)
:raises SyntaxError: when no application, controller or function is
available
:raises SyntaxError: when a CRLF is found in the generated url
</pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="verifyURL"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">verifyURL</span>(<span class="sig-arg">request</span>,
<span class="sig-arg">hmac_key</span>=<span class="sig-default">1</span>,
<span class="sig-arg">hash_vars</span>=<span class="sig-default">True</span>,
<span class="sig-arg">salt</span>=<span class="sig-default">1</span>,
<span class="sig-arg">user_signature</span>=<span class="sig-default">1</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.html-pysrc.html#verifyURL">source code</a></span>
</td>
</table>
<pre class="literalblock">
Verifies that a request's args & vars have not been tampered with by the user
:param request: web2py's request object
:param hmac_key: the key to authenticate with, must be the same one previously
used when calling URL()
:param hash_vars: which vars to include in our hashing. (Optional)
Only uses the 1st value currently
True (or undefined) means all, False none,
an iterable just the specified keys
do not call directly. Use instead:
URL.verify(hmac_key='...')
the key has to match the one used to generate the URL.
>>> r = Storage()
>>> gv = Storage(p=(1,3),q=2,_signature='5d06bb8a4a6093dd325da2ee591c35c61afbd3c6')
>>> r.update(dict(application='a', controller='c', function='f'))
>>> r['args'] = ['x', 'y', 'z']
>>> r['get_vars'] = gv
>>> verifyURL(r, 'key')
True
>>> verifyURL(r, 'kay')
False
>>> r.get_vars.p = (3, 1)
>>> verifyURL(r, 'key')
True
>>> r.get_vars.p = (3, 2)
>>> verifyURL(r, 'key')
False
</pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="embed64"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">embed64</span>(<span class="sig-arg">filename</span>=<span class="sig-default">1</span>,
<span class="sig-arg">file</span>=<span class="sig-default">1</span>,
<span class="sig-arg">data</span>=<span class="sig-default">1</span>,
<span class="sig-arg">extension</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">image/gif</code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.html-pysrc.html#embed64">source code</a></span>
</td>
</table>
<p>helper to encode the provided (binary) data into base64.</p>
:param filename: if provided, opens and reads this file in 'rb' mode
:param file: if provided, reads this file :param data: if provided, uses
the provided data
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="test"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">test</span>()</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="web2py.gluon.html-pysrc.html#test">source code</a></span>
</td>
</table>
Example:
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> validators <span class="py-keyword">import</span> *
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> DIV(A(<span class="py-string">'click me'</span>, _href=URL(a=<span class="py-string">'a'</span>, c=<span class="py-string">'b'</span>, f=<span class="py-string">'c'</span>)), BR(), HR(), DIV(SPAN(<span class="py-string">"World"</span>), _class=<span class="py-string">'unknown'</span>)).xml()
<span class="py-output"><div><a href="/a/b/c">click me</a><br /><hr /><div class="unknown"><span>World</span></div></div></span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> DIV(UL(<span class="py-string">"doc"</span>,<span class="py-string">"cat"</span>,<span class="py-string">"mouse"</span>)).xml()
<span class="py-output"><div><ul><li>doc</li><li>cat</li><li>mouse</li></ul></div></span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> DIV(UL(<span class="py-string">"doc"</span>, LI(<span class="py-string">"cat"</span>, _class=<span class="py-string">'feline'</span>), 18)).xml()
<span class="py-output"><div><ul><li>doc</li><li class="feline">cat</li><li>18</li></ul></div></span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> TABLE([<span class="py-string">'a'</span>, <span class="py-string">'b'</span>, <span class="py-string">'c'</span>], TR(<span class="py-string">'d'</span>, <span class="py-string">'e'</span>, <span class="py-string">'f'</span>), TR(TD(1), TD(2), TD(3))).xml()
<span class="py-output"><table><tr><td>a</td><td>b</td><td>c</td></tr><tr><td>d</td><td>e</td><td>f</td></tr><tr><td>1</td><td>2</td><td>3</td></tr></table></span>
<span class="py-output"></span><span class="py-prompt">>>> </span>form=FORM(INPUT(_type=<span class="py-string">'text'</span>, _name=<span class="py-string">'myvar'</span>, requires=IS_EXPR(<span class="py-string">'int(value)<10'</span>)))
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.xml()
<span class="py-output"><form action="" enctype="multipart/form-data" method="post"><input name="myvar" type="text" /></form></span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.accepts({<span class="py-string">'myvar'</span>:<span class="py-string">'34'</span>}, formname=None)
<span class="py-output">False</span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.xml()
<span class="py-output"><form action="" enctype="multipart/form-data" method="post"><input name="myvar" type="text" value="34" /><div class="error" id="myvar__error">invalid expression</div></form></span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.accepts({<span class="py-string">'myvar'</span>:<span class="py-string">'4'</span>}, formname=None, keepvalues=True)
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.xml()
<span class="py-output"><form action="" enctype="multipart/form-data" method="post"><input name="myvar" type="text" value="4" /></form></span>
<span class="py-output"></span><span class="py-prompt">>>> </span>form=FORM(SELECT(<span class="py-string">'cat'</span>, <span class="py-string">'dog'</span>, _name=<span class="py-string">'myvar'</span>))
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.accepts({<span class="py-string">'myvar'</span>:<span class="py-string">'dog'</span>}, formname=None, keepvalues=True)
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.xml()
<span class="py-output"><form action="" enctype="multipart/form-data" method="post"><select name="myvar"><option value="cat">cat</option><option selected="selected" value="dog">dog</option></select></form></span>
<span class="py-output"></span><span class="py-prompt">>>> </span>form=FORM(INPUT(_type=<span class="py-string">'text'</span>, _name=<span class="py-string">'myvar'</span>, requires=IS_MATCH(<span class="py-string">'^\w+$'</span>, <span class="py-string">'only alphanumeric!'</span>)))
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.accepts({<span class="py-string">'myvar'</span>:<span class="py-string">'as df'</span>}, formname=None)
<span class="py-output">False</span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">print</span> form.xml()
<span class="py-output"><form action="" enctype="multipart/form-data" method="post"><input name="myvar" type="text" value="as df" /><div class="error" id="myvar__error">only alphanumeric!</div></form></span>
<span class="py-output"></span><span class="py-prompt">>>> </span>session={}
<span class="py-prompt">>>> </span>form=FORM(INPUT(value=<span class="py-string">"Hello World"</span>, _name=<span class="py-string">"var"</span>, requires=IS_MATCH(<span class="py-string">'^\w+$'</span>)))
<span class="py-prompt">>>> </span><span class="py-keyword">if</span> form.accepts({}, session,formname=None): <span class="py-keyword">print</span> <span class="py-string">'passed'</span>
<span class="py-prompt">>>> </span><span class="py-keyword">if</span> form.accepts({<span class="py-string">'var'</span>:<span class="py-string">'test '</span>, <span class="py-string">'_formkey'</span>: session[<span class="py-string">'_formkey[None]'</span>]}, session, formname=None): <span class="py-keyword">print</span> <span class="py-string">'passed'</span></pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="web2py.gluon-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0beta1 on Thu Aug 4 00:46:59 2011
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>