suppress separators

This commit is contained in:
2021-01-17 18:12:33 +01:00
parent fc2551a8d2
commit f0ba368f2a
66 changed files with 5 additions and 241 deletions

View File

@ -51,10 +51,10 @@ class VariableAnnotator:
def __init__(self,
objectspace,
):
if not hasattr(objectspace.space, 'variables'):
return
self.objectspace = objectspace
if hasattr(self.objectspace.space, 'variables'):
self.convert_variable()
self.convert_separators()
self.convert_variable()
def _convert_variable(self,
namespace: str,
@ -140,17 +140,3 @@ class VariableAnnotator:
variable,
'variable',
)
def convert_separators(self): # pylint: disable=C0111,R0201
for family in self.objectspace.space.variables.values():
if not hasattr(family, 'separators'):
continue
if hasattr(family.separators, 'separator'):
for separator in family.separators.separator:
option = self.objectspace.paths.get_variable(separator.name)
if hasattr(option, 'separator'):
xmlfiles = self.objectspace.display_xmlfiles(separator.xmlfiles)
msg = _(f'{separator.name} already has a separator in {xmlfiles}')
raise DictConsistencyError(msg, 35)
option.separator = separator.text
del family.separators

View File

@ -79,7 +79,7 @@
<!ATTLIST override source CDATA #IMPLIED >
<!ATTLIST override templating (True|False) "True">
<!ELEMENT variables (family*, separators*)>
<!ELEMENT variables (family*)>
<!ELEMENT family (variable*)>
<!ATTLIST family name CDATA #REQUIRED>
<!ATTLIST family description CDATA #IMPLIED>
@ -107,11 +107,6 @@
<!ATTLIST variable remove_fill (True|False) "False">
<!ATTLIST variable test CDATA #IMPLIED>
<!ELEMENT separators (separator*)>
<!ELEMENT separator (#PCDATA)>
<!ATTLIST separator name CDATA #REQUIRED>
<!ELEMENT value (#PCDATA)>
<!ELEMENT constraints ((fill* | check* | condition* | group*)*)>

View File

@ -8,7 +8,7 @@ from .annotator import ERASED_ATTRIBUTES, CONVERT_OPTION
FUNC_TO_DICT = []
FORCE_INFORMATIONS = ['help', 'test', 'separator', 'manage']
FORCE_INFORMATIONS = ['help', 'test', 'manage']
ATTRIBUTES_ORDER = ('name', 'doc', 'default', 'multi')