Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
tempita
/
__pycache__
/
File Content:
__init__.cpython-37.pyc
B ��]� � @ sJ d Z ddlZddlZddlZddlmZ ddlZddlZddl m Z ddlmZ ddl mZmZmZmZmZ ddd d ddd gZe�d�Ze�dej�ZG dd� de�ZG dd� de�ZG dd� de�Zdd� ZG dd� de�ZdVdd �ZdWdd�Z G dd � d e!�Z"G dd� de�Z#dXdd�Z$d d!� Z%d"d#� Z&G d$d � d e�Z'd%d� Z(G d&d'� d'e�Z)G d(d)� d)e�Z*G d*d+� d+e�Z+G d,d-� d-e�Z,e,� Z-[,dYd.d/�Z.e�d0�Z/d1d2d3d4d5d6gZ0e�d7�Z1e�d8�Z2d9d:� Z3d;d<� Z4dZd=d>�Z5d[d@dA�Z6dBdC� Z7dDdE� Z8dFdG� Z9dHdI� Z:dJdK� Z;dLdM� Z<dNdO� Z=dPdQ� Z>dRZ?d\dSdT�Z@eAdUk�rFe@� 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. � N)�quote)�StringIO)�looper)�bytes�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"