reorder dictionaries not only in same directory
This commit is contained in:
parent
8067baeb27
commit
703250c34f
|
@ -61,19 +61,26 @@ class XMLReflector:
|
||||||
|
|
||||||
:param xmlfolders: list of full folder's name
|
:param xmlfolders: list of full folder's name
|
||||||
"""
|
"""
|
||||||
|
filenames = {}
|
||||||
for xmlfolder in xmlfolders:
|
for xmlfolder in xmlfolders:
|
||||||
filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \
|
for filename in listdir(xmlfolder):
|
||||||
filename.endswith('.xml')]
|
if not filename.endswith('.xml'):
|
||||||
filenames.sort()
|
continue
|
||||||
if not filenames:
|
if filename in filenames:
|
||||||
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
|
raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [xmlfolder])
|
||||||
for xmlfile in filenames:
|
filenames[filename] = join(xmlfolder, filename)
|
||||||
try:
|
if not filenames:
|
||||||
document = parse(xmlfile)
|
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
|
||||||
except XMLSyntaxError as err:
|
file_names = list(filenames.keys())
|
||||||
raise DictConsistencyError(_(f'not a XML file: {err}'), 52, [xmlfile]) from err
|
file_names.sort()
|
||||||
if not self.dtd.validate(document):
|
for filename in file_names:
|
||||||
dtd_error = self.dtd.error_log.filter_from_errors()[0]
|
xmlfile = filenames[filename]
|
||||||
msg = _(f'not a valid XML file: {dtd_error}')
|
try:
|
||||||
raise DictConsistencyError(msg, 43, [xmlfile])
|
document = parse(xmlfile)
|
||||||
yield xmlfile, document.getroot()
|
except XMLSyntaxError as err:
|
||||||
|
raise DictConsistencyError(_(f'not a XML file: {err}'), 52, [xmlfile]) from err
|
||||||
|
if not self.dtd.validate(document):
|
||||||
|
dtd_error = self.dtd.error_log.filter_from_errors()[0]
|
||||||
|
msg = _(f'not a valid XML file: {dtd_error}')
|
||||||
|
raise DictConsistencyError(msg, 43, [xmlfile])
|
||||||
|
yield xmlfile, document.getroot()
|
||||||
|
|
|
@ -14,8 +14,8 @@ try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))
|
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
||||||
|
|
Loading…
Reference in New Issue