does not allow services and rougail namespace
This commit is contained in:
@ -141,6 +141,11 @@ class RougailObjSpace:
|
||||
):
|
||||
"""Parses a Rougail XML file and populates the RougailObjSpace
|
||||
"""
|
||||
if namespace in ['services', Config['variable_namespace']]:
|
||||
msg = _(f'Namespace name "{namespace}" is not allowed in "{xmlfile}"')
|
||||
raise DictConsistencyError(msg, 21)
|
||||
if not namespace:
|
||||
namespace = Config['variable_namespace']
|
||||
redefine_variables = []
|
||||
self._xml_parse(xmlfile,
|
||||
document,
|
||||
|
@ -6,7 +6,8 @@ Sample usage::
|
||||
|
||||
>>> from rougail import Rougail
|
||||
>>> rougail = Rougail('/usr/share/rougail/rougail.dtd')
|
||||
>>> rougail.create_or_populate_from_xml('rougail', ['/usr/share/rougail/dicos'])
|
||||
>>> rougail.create_or_populate_from_xml(['/usr/share/rougail/dicos'])
|
||||
>>> rougail.create_or_populate_from_xml(['/usr/share/rougail/extra1'], 'extra1')
|
||||
>>> rougail.space_visitor('/usr/share/rougail/funcs.py')
|
||||
>>> tiramisu = rougail.save()
|
||||
|
||||
@ -39,8 +40,8 @@ class Rougail:
|
||||
self.funcs_path = None
|
||||
|
||||
def create_or_populate_from_xml(self,
|
||||
namespace: str,
|
||||
xmlfolders: List[str],
|
||||
namespace: str=None,
|
||||
) -> List[str]:
|
||||
"""Parses a bunch of XML files and populates the RougailObjSpace
|
||||
"""
|
||||
|
Reference in New Issue
Block a user