Your IP : 216.73.216.213
B
Z��Z�� � @ s� d Z ddlmZ ddlZddlZddlZyddlmZ W n e k
rX ddl
mZ Y nX ddlZddlZddl
mZ ddlmZ ddlmZmZmZmZmZmZ d d
ddd
ddgZe�d�Ze�dej�ZG dd � d e�ZG dd� de�ZG dd� de�Z dd� Z!G dd
� d
e"�Z#dXdd�Z$dYdd�Z%G dd� de&�Z'G dd� de"�Z(dZd d!�Z)d"d#� Z*d$d%� Z+G d&d� de#�Z,d'd
� Z-G d(d)� d)e"�Z.G d*d+� d+e"�Z/G d,d-� d-e"�Z0G d.d/� d/e"�Z1e1� Z2[1d[d0d1�Z3e�d2�Z4d3d4d5d6d7d8gZ5e�d9�Z6e�d:�Z7d;d<� Z8d=d>� Z9d\d?d@�Z:d]dBdC�Z;dDdE� Z<dFdG� Z=dHdI� Z>dJdK� Z?dLdM� Z@dNdO� ZAdPdQ� ZBdRdS� ZCdTZDd^dUdV�ZEeFdWk�r|eE� dS )_a�
A small templating language
This implements a small templating language. This language implements
if/elif/else, for/continue/break, expressions, and blocks of Python
code. The syntax is::
{{any expression (function calls etc)}}
{{any expression | filter}}
{{for x in y}}...{{endfor}}
{{if x}}x{{elif y}}y{{else}}z{{endif}}
{{py:x=1}}
{{py:
def foo(bar):
return 'baz'
}}
{{default var = default_value}}
{{# comment}}
You use this with the ``Template`` class or the ``sub`` shortcut.
The ``Template`` class takes the template string and the name of
the template (for errors) and a default namespace. Then (like
``string.Template``) you can call the ``tmpl.substitute(**kw)``
method to make a substitution (or ``tmpl.substitute(a_dict)``).
``sub(content, **kw)`` substitutes the template immediately. You
can use ``__name='tmpl.html'`` to set the name of the template.
If there are syntax errors ``TemplateError`` will be raised.
� )�absolute_importN)�quote)�StringIO� )�looper)�bytes�unicode_�basestring_�next�
is_unicode�coerce_text�
TemplateError�Template�sub�HTMLTemplate�sub_html�html�bunchz\s+in\s+z^[a-z_][a-z0-9_]*$c @ s"