remove todict

This commit is contained in:
2021-01-30 17:32:21 +01:00
parent c6cda5ce92
commit b76a04dd19
15 changed files with 44 additions and 17 deletions

View File

@ -32,9 +32,6 @@ from .annotator import CONVERT_OPTION
from .objspace import RootRougailObject
FUNC_TO_DICT = ['calc_value']
class Root(): # pylint: disable=R0903
"""Root classes
"""
@ -275,6 +272,8 @@ class Variable(Common):
if hasattr(self.elt, key):
keys[key] = getattr(self.elt, key)
for key, value in CONVERT_OPTION[self.elt.type].get('initkwargs', {}).items():
if isinstance(value, str):
value = f"'{value}'"
keys[key] = value
def calculation_value(self,
@ -329,7 +328,6 @@ class Variable(Common):
"""build variable parameters
"""
option_name = param.text.reflector_object.get()
todict = function in FUNC_TO_DICT
params = [f'{option_name}']
if hasattr(param, 'suffix'):
param_type = 'ParamDynOption'
@ -338,8 +336,6 @@ class Variable(Common):
param_type = 'ParamOption'
if param.notraisepropertyerror:
params.append(f'notraisepropertyerror={param.notraisepropertyerror}')
if todict:
params.append(f'todict={todict}')
return "{}({})".format(param_type, ', '.join(params))