Add docstrings to YamlFSM

This commit is contained in:
Kristóf Tóth 2018-07-27 14:00:45 +02:00
parent 8df196f258
commit 732b896d17

View File

@ -13,7 +13,17 @@ from tfw.fsm.fsm_base import FSMBase
class YamlFSM(FSMBase):
"""
This is a state machine capable of building itself from a YAML config file.
"""
def __init__(self, config_file, jinja2_variables=None):
"""
:param config_file: path of the YAML file
:param jinja2_variables: dict containing jinja2 variables
or str with filename of YAML file to
parse and use as dict.
jinja2 support is disabled if this is None
"""
self.config = ConfigParser(config_file, jinja2_variables).config
self.setup_states()
super().__init__() # FSMBase.__init__() requires states