mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 18:21:31 +00:00
Rename config transformation method for easier understanding
This commit is contained in:
parent
7f583d8d1f
commit
7cfa63bacf
@ -21,7 +21,7 @@ class YamlFSM(FSMBase):
|
|||||||
return yaml.safe_load(ifile)
|
return yaml.safe_load(ifile)
|
||||||
|
|
||||||
def setup_states(self):
|
def setup_states(self):
|
||||||
self.for_config_states_and_transitions_do(self.patch_config_callbacks)
|
self.for_config_states_and_transitions_do(self.wrap_callbacks_with_subprocess_call)
|
||||||
self.states = [State(**state) for state in self.config['states']]
|
self.states = [State(**state) for state in self.config['states']]
|
||||||
|
|
||||||
def setup_transitions(self):
|
def setup_transitions(self):
|
||||||
@ -35,7 +35,7 @@ class YamlFSM(FSMBase):
|
|||||||
what(json_obj)
|
what(json_obj)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def patch_config_callbacks(json_obj):
|
def wrap_callbacks_with_subprocess_call(json_obj):
|
||||||
topatch = ('on_enter', 'on_exit', 'prepare', 'before', 'after')
|
topatch = ('on_enter', 'on_exit', 'prepare', 'before', 'after')
|
||||||
for key in json_obj:
|
for key in json_obj:
|
||||||
if key in topatch:
|
if key in topatch:
|
||||||
|
Loading…
Reference in New Issue
Block a user