Ñò
xT)Kc @ s_ d Z d Z d d d !Z d d k l Z d e f d YZ d d
d
YZ d Z d S( sù Provides helpers for Template.webInput(), a method for importing web
transaction variables in bulk. See the docstring of webInput for full details.
Meta-Data
================================================================================
Author: Mike Orr
License: This software is released for unlimited distribution under the
terms of the MIT license. See the LICENSE file.
Version: $Revision: 1.10 $
Start Date: 2002/03/17
Last Revision Date: $Date: 2006/01/06 21:56:54 $
s Mike Orr s $Revision: 1.10 $i iŝ˙˙˙i˙˙˙˙( t
useOrRaiset NonNumericInputErrorc B s e Z RS( ( t __name__t
__module__( ( ( sA /usr/lib64/python2.6/site-packages/Cheetah/Utils/WebInputMixin.pyR s t
_Converterc B s e Z d Z d Z RS( s" A container object for info about type converters.
.name, string, name of this converter (for error messages).
.func, function, factory function.
.default, value to use or raise if the real value is missing.
.error, value to use or raise if .func() raises an exception.
c C s( | | _ | | _ | | _ | | _ d S( N( t namet funct defaultt error( t selfR R R R ( ( sA /usr/lib64/python2.6/site-packages/Cheetah/Utils/WebInputMixin.pyt __init__ s ( R R t __doc__R
( ( ( sA /usr/lib64/python2.6/site-packages/Cheetah/Utils/WebInputMixin.pyR s c
C sè | i d } | d j o# | } | | | | d } } n | } } d } | | j o# | | d p
| | d } n | | d } | d j o
g } n t | t o
| g } n y | | } Wn5 t j
o) d }
| | f } t |
| n X| i d j o | } g } xy | D]m }
y | i |
}
WnD t t f j
o2 | i |
f } d | } t | i
| }
n X| i |
q,Wn | o | | f St | d j o | t | i
f S| | d f S( s Look up a Webware field/cookie/value/session value. Return
'(realName, value)' where 'realName' is like 'name' but with any
conversion suffix strips off. Applies numeric conversion and
single vs multi values according to the comments in the source.
t :i˙˙˙˙i t s* '%s' is not a valid converter name in '%s's# %s '%s' contains invalid charactersi N( t findt Nonet
isinstancet strt KeyErrort TypeErrorR t
ValueErrorR R R t appendt lenR ( R R t multit
converterst colont longNamet shortNamet extt valuest convertert fmtt tupt tmpt elmt errmsg( ( sA /usr/lib64/python2.6/site-packages/Cheetah/Utils/WebInputMixin.pyt _lookup&