reorder dictionaries not only in same directory

This commit is contained in:
Emmanuel Garette 2021-11-28 17:04:47 +01:00
parent 8067baeb27
commit 703250c34f
2 changed files with 24 additions and 17 deletions

View file

@ -61,13 +61,20 @@ class XMLReflector:
:param xmlfolders: list of full folder's name
"""
filenames = {}
for xmlfolder in xmlfolders:
filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \
filename.endswith('.xml')]
filenames.sort()
for filename in listdir(xmlfolder):
if not filename.endswith('.xml'):
continue
if filename in filenames:
raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [xmlfolder])
filenames[filename] = join(xmlfolder, filename)
if not filenames:
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
for xmlfile in filenames:
file_names = list(filenames.keys())
file_names.sort()
for filename in file_names:
xmlfile = filenames[filename]
try:
document = parse(xmlfile)
except XMLSyntaxError as err:

View file

@ -14,8 +14,8 @@ try:
from tiramisu3 import *
except:
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_4 = StrOption(name="mode_conteneur_actif1", 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_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_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])