File: //lib/python3/dist-packages/genshi/template/__pycache__/base.cpython-312.pyc
�
EMab�^ � � � d Z ddlmZ ddlZddlZddlmZmZmZ ddl m
Z
mZmZm
Z
mZmZ ddlmZ g d�ZdZ G d � d
e� Z G d� de� Z G d
� de� Z G d� de� Z G d� de� Zd� Zdd�Zdd�Z G d� de� Z ej@ e� G d� de� � Z! G d� de!� Z"e"jF Z#e"jH Z$e"jJ Z%e"jL Z&y)zBasic templating functionality.� )�dequeN)�
numeric_types�StringIO�BytesIO)�Attrs�Stream�StreamEventKind�START�TEXT�_ensure)�
ParseError)�Context�DirectiveFactory�Template�
TemplateError�TemplateRuntimeError�TemplateSyntaxError�BadDirectiveErrorzrestructuredtext enc � � e Zd ZdZdd�Zy)r z?Base exception class for errors related to template processing.Nc � � |�d}|| _ |dk7 s|dk\ rd| j ||fz }t j | |� || _ || _ || _ y)a9 Create the exception.
:param message: the error message
:param filename: the filename of the template
:param lineno: the number of line in the template at which the error
occurred
:param offset: the column number at which the error occurred
Nz<string>r z%s (%s, line %d))�msg� Exception�__init__�filename�lineno�offset��self�messager r r s �6/usr/lib/python3/dist-packages/genshi/template/base.pyr zTemplateError.__init__! s^ � � ��!�H�����z�!�V�q�[�(�D�H�H�h��+G�G�G����4��)� ��
������� �N���r# ��__name__�
__module__�__qualname__�__doc__r � r! r r r s
� �I�r! r c � � e Zd ZdZdd�Zy)r z|Exception raised when an expression in a template causes a Python syntax
error, or the template is not well-formed.
Nc � � t |t � r4|j �(t |� j d|j z d� }t
j
| |||� y)a8 Create the exception
:param message: the error message
:param filename: the filename of the template
:param lineno: the number of line in the template at which the error
occurred
:param offset: the column number at which the error occurred
Nz
(line %d)� )�
isinstance�SyntaxErrorr �str�replacer r r s r r zTemplateSyntaxError.__init__: sJ � � �g�{�+����0J��'�l�*�*�<�'�.�.�+H�"�M�G����t�W�h��?r! r"