feat: add new get_root_option function
This commit is contained in:
parent
c4b90cbe42
commit
c8d5656094
1 changed files with 11 additions and 8 deletions
|
|
@ -37,18 +37,21 @@ class Rougail(UserDatas):
|
||||||
self.converted = RougailConvert(self.rougailconfig)
|
self.converted = RougailConvert(self.rougailconfig)
|
||||||
self.config = None
|
self.config = None
|
||||||
|
|
||||||
|
def get_root_option(self):
|
||||||
|
tiram_obj = self.converted.save()
|
||||||
|
optiondescription = {}
|
||||||
|
custom_types = {
|
||||||
|
custom.__name__: custom
|
||||||
|
for custom in self.rougailconfig["custom_types"].values()
|
||||||
|
}
|
||||||
|
exec(tiram_obj, custom_types, optiondescription) # pylint: disable=W0122
|
||||||
|
return optiondescription["option_0"]
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Get Tiramisu Config"""
|
"""Get Tiramisu Config"""
|
||||||
if not self.config:
|
if not self.config:
|
||||||
tiram_obj = self.converted.save()
|
|
||||||
optiondescription = {}
|
|
||||||
custom_types = {
|
|
||||||
custom.__name__: custom
|
|
||||||
for custom in self.rougailconfig["custom_types"].values()
|
|
||||||
}
|
|
||||||
exec(tiram_obj, custom_types, optiondescription) # pylint: disable=W0122
|
|
||||||
self.config = Config(
|
self.config = Config(
|
||||||
optiondescription["option_0"],
|
self.get_root_option(),
|
||||||
display_name=tiramisu_display_name,
|
display_name=tiramisu_display_name,
|
||||||
)
|
)
|
||||||
self.config.property.read_write()
|
self.config.property.read_write()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue