| Server IP : 93.86.61.54 / Your IP : 216.73.216.206 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/pystache/__pycache__/ |
Upload File : |
o
r|a� � @ s d Z G dd� de�ZdS )zC
Exposes a class that represents a parsed (or compiled) template.
c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )�ParsedTemplatea
Represents a parsed or compiled template.
An instance wraps a list of unicode strings and node objects. A node
object must have a `render(engine, stack)` method that accepts a
RenderEngine instance and a ContextStack instance and returns a unicode
string.
c C s
g | _ d S �N)�_parse_tree��self� r �1/usr/lib/python3/dist-packages/pystache/parsed.py�__init__ �
zParsedTemplate.__init__c C s
t | j�S r )�reprr r r r r �__repr__ r zParsedTemplate.__repr__c C s | j �|� dS )z�
Arguments:
node: a unicode string or node object instance. See the class
docstring for information.
N)r �append)r �noder r r �add s zParsedTemplate.addc s0 � �fdd�}t t|| j��}d�|�}t|�S )z5
Returns: a string of type unicode.
c s t | �tu r| S | ��� �S r )�type�str�render)r
��context�enginer r �get_unicode+ s z*ParsedTemplate.render.<locals>.get_unicode� )�list�mapr �joinr )r r r r �parts�sr r r r % s
zParsedTemplate.renderN)�__name__�
__module__�__qualname__�__doc__r r r r r r r r r s
r N)r �objectr r r r r �<module> s