Package gensaschema :: Module _template :: Class Template
[frames] | no frames]

Class Template

source code

object --+
         |
        Template

Template container
Instance Methods
 
__init__(self, template, dedent=True, rstrip=True)
Initialization
source code
str
expand(self, *args, **kwargs)
Expand the template
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, template, dedent=True, rstrip=True)
(Constructor)

source code 
Initialization
Parameters:
  • template (str) - Template string
  • dedent (bool) - Dedent automatically?
  • rstrip (bool) - rstrip the template automatically?
Overrides: object.__init__

expand(self, *args, **kwargs)

source code 

Expand the template

Either args or kwargs may be given, but not both. If nothing is given, nothing will be expanded.

Parameters:
  • args (tuple) - Positional parameters to expand
  • kwargs (dict) - Keyword arguments to expand
Returns: str
The expanded string
Raises:
  • TypeError - Both args and kwargs given