Repository URL to install this package:
|
Version:
1.0.11 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
coverage
/
__pycache__
/
templite.cpython-37.pyc
|
|---|
B
Fg1x
Âã @ sL d Z ddlZG dd deZG dd deZG dd dZG d d
d
ZdS )zÅA simple Python template renderer, for a nano-subset of Django syntax.
For a detailed discussion of this code, see this chapter from 500 Lines:
http://aosabook.org/en/500L/a-template-engine.html
é Nc @ s e Zd ZdZdS )ÚTempliteSyntaxErrorz*Raised when a template has a syntax error.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r r ú/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/templite.pyr s r c @ s e Zd ZdZdS )ÚTempliteValueErrorz7Raised when an expression won't evaluate in a template.N)r r r r r r r r r s r c @ sN e Zd ZdZdddZdd Zdd Zd d
ZdZdd
Z dd Z
dd ZdS )ÚCodeBuilderzBuild source code conveniently.r c C s g | _ || _d S )N)ÚcodeÚindent_level)ÚselfÚindentr r r Ú__init__ s zCodeBuilder.__init__c C s d dd | jD ¡S )NÚ c s s | ]}t |V qd S )N)Ústr)Ú.0Úcr r r ú <genexpr>" s z&CodeBuilder.__str__.<locals>.<genexpr>)Újoinr )r
r r r Ú__str__! s zCodeBuilder.__str__c C s | j d| j |dg¡ dS )zwAdd a line of source to the code.
Indentation and newline will be added for you, don't provide them.
ú Ú
N)r Úextendr )r
Úliner r r Úadd_line$ s zCodeBuilder.add_linec C s t | j}| j |¡ |S )z!Add a section, a sub-CodeBuilder.)r
r r Úappend)r
Úsectionr r r Úadd_section, s
zCodeBuilder.add_sectioné c C s | j | j7 _ dS )z0Increase the current indent for following lines.N)r ÚINDENT_STEP)r
r r r r 4 s zCodeBuilder.indentc C s | j | j8 _ dS )z0Decrease the current indent for following lines.N)r r )r
r r r Údedent8 s zCodeBuilder.dedentc C s( | j dkstt| }i }t|| |S )z:Execute the code, and return a dict of globals it defines.r )r ÚAssertionErrorr Úexec)r
Z
python_sourceZglobal_namespacer r r Úget_globals<