Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
grepros.vendor.step.Template Class Reference
Inheritance diagram for grepros.vendor.step.Template:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, template, strip=True, escape=False, postprocess=None)
 
def expand (self, namespace=None, **kw)
 
def stream (self, buffer, namespace=None, encoding="utf-8", buffer_size=65536, **kw)
 

Public Attributes

 builtins
 
 code
 
 options
 
 template
 

Static Public Attributes

dictionary COMPILED_TEMPLATES = {}
 
 RE_STRIP = re.compile("(^[ \t]+|[ \t]+$|(?<=[ \t])[ \t]+|\\A[\r\n]+|[ \t\r\n]+\\Z)", re.M)
 
 RE_STRIP_STREAM
 
dictionary TRANSPILED_TEMPLATES = {}
 

Private Member Functions

def _make_namespace (self, namespace, echo, **kw)
 
def _postprocess (self, output, stream=False)
 
def _preprocess (self, template)
 
def _process (self, template)
 

Detailed Description

Definition at line 43 of file step.py.

Constructor & Destructor Documentation

◆ __init__()

def grepros.vendor.step.Template.__init__ (   self,
  template,
  strip = True,
  escape = False,
  postprocess = None 
)
Initialize class

Definition at line 52 of file step.py.

Member Function Documentation

◆ _make_namespace()

def grepros.vendor.step.Template._make_namespace (   self,
  namespace,
  echo,
**  kw 
)
private
Return template namespace dictionary, containing given values and template functions.

Definition at line 84 of file step.py.

◆ _postprocess()

def grepros.vendor.step.Template._postprocess (   self,
  output,
  stream = False 
)
private
Modify output string after variables and code evaluation

Definition at line 147 of file step.py.

◆ _preprocess()

def grepros.vendor.step.Template._preprocess (   self,
  template 
)
private
Modify template string before code conversion

Definition at line 90 of file step.py.

◆ _process()

def grepros.vendor.step.Template._process (   self,
  template 
)
private
Return the code generated from the template string

Definition at line 106 of file step.py.

◆ expand()

def grepros.vendor.step.Template.expand (   self,
  namespace = None,
**  kw 
)
Return the expanded template string

Definition at line 64 of file step.py.

◆ stream()

def grepros.vendor.step.Template.stream (   self,
  buffer,
  namespace = None,
  encoding = "utf-8",
  buffer_size = 65536,
**  kw 
)
Expand the template and stream it to a file-like buffer.

Definition at line 70 of file step.py.

Member Data Documentation

◆ builtins

grepros.vendor.step.Template.builtins

Definition at line 58 of file step.py.

◆ code

grepros.vendor.step.Template.code

Definition at line 62 of file step.py.

◆ COMPILED_TEMPLATES

dictionary grepros.vendor.step.Template.COMPILED_TEMPLATES = {}
static

Definition at line 46 of file step.py.

◆ options

grepros.vendor.step.Template.options

Definition at line 57 of file step.py.

◆ RE_STRIP

grepros.vendor.step.Template.RE_STRIP = re.compile("(^[ \t]+|[ \t]+$|(?<=[ \t])[ \t]+|\\A[\r\n]+|[ \t\r\n]+\\Z)", re.M)
static

Definition at line 48 of file step.py.

◆ RE_STRIP_STREAM

grepros.vendor.step.Template.RE_STRIP_STREAM
static
Initial value:
= re.compile("(^[ \t]+|[ \t]+$|(?<=[ \t])[ \t]+|\\A[\r\n]+|"
"((?<=(\r\n))|(?<=[ \t\r\n]))[ \t\r\n]+\\Z)", re.M)

Definition at line 49 of file step.py.

◆ template

grepros.vendor.step.Template.template

Definition at line 56 of file step.py.

◆ TRANSPILED_TEMPLATES

dictionary grepros.vendor.step.Template.TRANSPILED_TEMPLATES = {}
static

Definition at line 45 of file step.py.


The documentation for this class was generated from the following file:


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:30