mò +á¸Ec@sbdZdZddd!ZdklZlZlZlZlZdkl Z dfd„ƒYZ d S( sÁNested namespace access The 'with' tag is used to introduce nested namespaces. The text enclosed in the with tag is rendered using information from the given variable or expression. For example, if the variable 'person' is bound to an object that has attributes 'name' and 'age', then a 'with' tag like the following can be used to access these attributes:: , Eather a 'name' or an 'expr' attribute may be used to specify data. A 'mapping' attribute may be used to indicate that the given data should be treated as mapping object, rather than as an object with named attributes. s8$Id: DT_With.py 40218 2005-11-18 14:39:19Z andreasjung $s$Revision: 1.15 $i iþÿÿÿ(s parse_paramss name_params InstanceDicts render_blockssstr(s TemplateDicttWithcBs8tZfZdZdZdZd„Zd„ZeZ RS(Ntwithic Csâ|d\}}}t|ddddddddƒ}t|ddƒ\}}|djo |}n |i }|||_ |_|i|_|i dƒo|do d|_ n|i dƒo|do d|_ndS( NitnamettexprtmappingitonlyR(tblocksttnametargstsectiont parse_paramst name_paramRRtNonetevaltselft__name__thas_keyRR(RRRRR RR ((t7/data/zmath/zope/lib/python/DocumentTemplate/DT_With.pyt__init__/s$    cCs&|i}t|ƒtdƒjo||}n ||ƒ}|ipMt|ƒtfƒjo!t|ƒdjo|d}nt||ƒ}n|ioS|}t ƒ}t |dƒo|i |_ nt |dƒo|i |_ qðn|i|ƒzt|i|ƒSWd|idƒXdS(NRiitguarded_getattrtguarded_getitem(RRttypetmdtvRtlent InstanceDictRt_mdt TemplateDictthasattrRRt_pusht render_blocksR t_pop(RRRRR((Rtrender:s&   ,   ( Rt __module__tblockContinuationsRR RRRR!t__call__(((RR)s N( t__doc__t __rcs_id__t __version__tDT_UtilR R RRtstrRR( RR&RRR)R'RR R ((Rt?"s  %