provider and hidden
This commit is contained in:
@ -56,11 +56,13 @@ class Annotator(Walk):
|
||||
# hidden variable is also frozen
|
||||
if isinstance(variable, self.objectspace.variable) and variable.hidden is True and \
|
||||
variable.name != self.objectspace.rougailconfig['auto_freeze_variable']:
|
||||
if not variable.auto_freeze:
|
||||
if not variable.auto_freeze and \
|
||||
not hasattr(variable, 'provider'):
|
||||
variable.frozen = True
|
||||
if not variable.auto_save and \
|
||||
not variable.auto_freeze and \
|
||||
'force_default_on_freeze' not in vars(variable):
|
||||
'force_default_on_freeze' not in vars(variable) and \
|
||||
not hasattr(variable, 'provider'):
|
||||
variable.force_default_on_freeze = True
|
||||
if not hasattr(variable, 'properties'):
|
||||
variable.properties = []
|
||||
|
@ -28,8 +28,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
from json import dumps
|
||||
from os.path import isfile
|
||||
|
||||
from .i18n import _
|
||||
from .annotator import CONVERT_OPTION
|
||||
from .objspace import RootRougailObject
|
||||
from .error import DictConsistencyError
|
||||
|
||||
|
||||
class BaseElt: # pylint: disable=R0903
|
||||
@ -213,7 +215,11 @@ class Common:
|
||||
self.populate_attrib()
|
||||
self.populate_informations()
|
||||
if hasattr(self.elt, 'provider'):
|
||||
self.providers['provider:' + self.elt.provider] = self.dynamic_path
|
||||
name = 'provider:' + self.elt.provider
|
||||
if name in self.providers:
|
||||
msg = f'provider {name} declare multiple time'
|
||||
raise DictConsistencyError(msg, 79, self.elt.xmlfiles)
|
||||
self.providers[name] = self.dynamic_path
|
||||
return self.option_name
|
||||
|
||||
def populate_attrib(self):
|
||||
@ -303,7 +309,7 @@ class Common:
|
||||
return 'ParamSuffix()'
|
||||
if param.type == 'index':
|
||||
return 'ParamIndex()'
|
||||
raise Exception(f'unknown type {param.type}') # pragma: no cover
|
||||
raise Exception(_(f'unknown type {param.type}')) # pragma: no cover
|
||||
|
||||
@staticmethod
|
||||
def build_option_param(param,
|
||||
|
Reference in New Issue
Block a user