config as first argument

This commit is contained in:
gwen 2019-02-08 11:30:29 +01:00
parent f7119d5b4c
commit 9cc096a7db

View File

@ -113,7 +113,7 @@ class TiramisuOptionOption:
class TiramisuOptionProperty:
# config.option(path).property
def __init__(self,
config,
config: 'Config',
path: str,
model: Dict) -> None:
self.config = config
@ -328,8 +328,8 @@ class TiramisuOptionDescription(_Option):
self.model,
self.form)
if subfunc == 'property':
return TiramisuOptionProperty(self.path,
self.config,
return TiramisuOptionProperty(self.config,
self.path,
self.model.get(self.path, {}))
if subfunc == 'value':
return TiramisuOptionValue(self.config,
@ -398,8 +398,8 @@ class TiramisuOption:
if subfunc == 'property':
if self.index != None:
raise NotImplementedError()
return TiramisuOptionProperty(self.path,
self.config,
return TiramisuOptionProperty(self.config,
self.path,
self.model.get(self.path, {}))
raise APIError(_('please specify a valid sub function ({})').format(subfunc))