Public Member Functions | Public Attributes | List of all members
libuavcan_dsdl_compiler.pyratemp.LoaderFile Class Reference

Public Member Functions

def __init__ (self, allowed_path=None, encoding='utf-8')
 
def load (self, filename)
 

Public Attributes

 encoding
 
 path
 

Detailed Description

Load template from a file.

When loading a template from a file, it's possible to including other
templates (by using 'include' in the template). But for simplicity
and security, all included templates have to be in the same directory!
(see ``allowed_path``)

Definition at line 385 of file pyratemp.py.

Constructor & Destructor Documentation

◆ __init__()

def libuavcan_dsdl_compiler.pyratemp.LoaderFile.__init__ (   self,
  allowed_path = None,
  encoding = 'utf-8' 
)
Init the loader.

:Parameters:
    - `allowed_path`: path of the template-files
    - `encoding`: encoding of the template-files
:Exceptions:
    - `ValueError`: if `allowed_path` is not a directory

Definition at line 393 of file pyratemp.py.

Member Function Documentation

◆ load()

def libuavcan_dsdl_compiler.pyratemp.LoaderFile.load (   self,
  filename 
)
Load a template from a file.

Check if filename is allowed and return its contens in unicode.

:Parameters:
    - `filename`: filename of the template without path
:Returns:
    the contents of the template-file in unicode
:Exceptions:
    - `ValueError`: if `filename` contains a path

Definition at line 407 of file pyratemp.py.

Member Data Documentation

◆ encoding

libuavcan_dsdl_compiler.pyratemp.LoaderFile.encoding

Definition at line 405 of file pyratemp.py.

◆ path

libuavcan_dsdl_compiler.pyratemp.LoaderFile.path

Definition at line 404 of file pyratemp.py.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04