can disabled a file

This commit is contained in:
2021-12-04 22:07:51 +01:00
parent 703250c34f
commit 757d9ec5c2
14 changed files with 166 additions and 3 deletions

View File

@ -33,7 +33,7 @@ from rougail.error import DictConsistencyError
# a object's attribute has some annotations
# that shall not be present in the exported (flatened) XML
ERASED_ATTRIBUTES = ('redefine', 'namespace', 'xmlfiles', 'disabled', 'name', 'manage')
ERASED_ATTRIBUTES2 = ('redefine', 'namespace', 'xmlfiles')
ERASED_ATTRIBUTES2 = ('redefine', 'namespace', 'xmlfiles', 'disabled')
ALLOW_ATTRIBUT_NOT_MANAGE = ['file', 'engine', 'target']
@ -152,11 +152,15 @@ class Annotator:
elt.xmlfiles,
)
family.variable = []
if hasattr(elt, 'disabled'):
disabled = elt.disabled
else:
disabled = False
activate_obj = self._generate_element('boolean',
None,
None,
'activate',
True,
not disabled,
elt,
'.'.join([subpath, 'activate']),
)

View File

@ -74,6 +74,7 @@
<!ATTLIST file redefine (True|False) "False">
<!ATTLIST file engine (none|creole|jinja2|creole_legacy) #IMPLIED>
<!ATTLIST file included (no|name|content) #IMPLIED>
<!ATTLIST file disabled (True|False) "False">
<!ELEMENT override EMPTY>
<!ATTLIST override source CDATA #IMPLIED>