Compare commits
No commits in common. "be491bfdb249fdedb654cf5b0de976e6b7da0785" and "ad1928bc8847988b62b9c6cd20cda04f4837eb4d" have entirely different histories.
be491bfdb2
...
ad1928bc88
3 changed files with 43 additions and 65 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2024-11-04 12:04+0100\n"
|
"POT-Creation-Date: 2024-11-01 11:05+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
@ -67,19 +67,19 @@ msgstr ""
|
||||||
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
|
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:281
|
#: src/rougail/convert.py:265
|
||||||
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
|
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:475
|
#: src/rougail/convert.py:459
|
||||||
msgid "unknown type {0} for {1}"
|
msgid "unknown type {0} for {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:1345
|
#: src/rougail/convert.py:1324
|
||||||
msgid "duplicate dictionary file name {0}"
|
msgid "duplicate dictionary file name {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:1392
|
#: src/rougail/convert.py:1371
|
||||||
msgid "Cannot execute annotate multiple time"
|
msgid "Cannot execute annotate multiple time"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,11 +162,13 @@ class Paths:
|
||||||
path = get_realpath(path, identifier_path)
|
path = get_realpath(path, identifier_path)
|
||||||
dynamic = None
|
dynamic = None
|
||||||
# version 1.0
|
# version 1.0
|
||||||
if version == "1.0":
|
if (
|
||||||
if not path in self._data and "{{ suffix }}" not in path:
|
version == "1.0"
|
||||||
|
and not path in self._data
|
||||||
|
and "{{ identifier }}" not in path
|
||||||
|
):
|
||||||
new_path = None
|
new_path = None
|
||||||
current_path = None
|
current_path = None
|
||||||
identifiers = []
|
|
||||||
for name in path.split("."):
|
for name in path.split("."):
|
||||||
parent_path = current_path
|
parent_path = current_path
|
||||||
if current_path:
|
if current_path:
|
||||||
|
|
@ -192,31 +194,13 @@ class Paths:
|
||||||
):
|
):
|
||||||
new_path += "." + name_dynamic
|
new_path += "." + name_dynamic
|
||||||
break
|
break
|
||||||
regexp = "^" + name_dynamic.replace("{{ identifier }}", "(.*)")
|
|
||||||
finded = findall(regexp, name)
|
|
||||||
if len(finded) != 1 or not finded[0]:
|
|
||||||
continue
|
|
||||||
if finded[0] == "{{ identifier }}":
|
|
||||||
identifiers.append(None)
|
|
||||||
else:
|
|
||||||
identifiers.append(finded[0])
|
|
||||||
if new_path is None:
|
|
||||||
new_path = name_dynamic
|
|
||||||
else:
|
|
||||||
new_path += "." + name_dynamic
|
|
||||||
parent_path = dynamic_path
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
if new_path:
|
if new_path:
|
||||||
new_path += "." + name
|
new_path += "." + name
|
||||||
else:
|
else:
|
||||||
new_path = name
|
new_path = name
|
||||||
path = new_path
|
path = new_path
|
||||||
else:
|
if version != "1.0" and not path in self._data:
|
||||||
identifiers = None
|
|
||||||
if "{{ suffix }}" in path:
|
|
||||||
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
|
||||||
elif not path in self._data:
|
|
||||||
current_path = None
|
current_path = None
|
||||||
parent_path = None
|
parent_path = None
|
||||||
new_path = current_path
|
new_path = current_path
|
||||||
|
|
@ -648,17 +632,14 @@ class ParserVariable:
|
||||||
family_obj["type"] = obj_type = "dynamic"
|
family_obj["type"] = obj_type = "dynamic"
|
||||||
if obj_type == "dynamic":
|
if obj_type == "dynamic":
|
||||||
family_is_dynamic = True
|
family_is_dynamic = True
|
||||||
|
parent_dynamic = path
|
||||||
if "{{ identifier }}" not in name:
|
if "{{ identifier }}" not in name:
|
||||||
if version == "1.0" and "{{ suffix }}" in name:
|
if "variable" in family_obj:
|
||||||
name = name.replace("{{ suffix }}", "{{ identifier }}")
|
|
||||||
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
|
||||||
elif "variable" in family_obj:
|
|
||||||
name += "{{ identifier }}"
|
name += "{{ identifier }}"
|
||||||
path += "{{ identifier }}"
|
path += "{{ identifier }}"
|
||||||
else:
|
else:
|
||||||
msg = f'dynamic family name must have "{{{{ identifier }}}}" in his name for "{path}"'
|
msg = f'dynamic family name must have "{{{{ identifier }}}}" in his name for "{path}"'
|
||||||
raise DictConsistencyError(msg, 13, [filename])
|
raise DictConsistencyError(msg, 13, [filename])
|
||||||
parent_dynamic = path
|
|
||||||
if version != "1.0" and not family_obj and comment:
|
if version != "1.0" and not family_obj and comment:
|
||||||
family_obj["description"] = comment
|
family_obj["description"] = comment
|
||||||
self.add_family(
|
self.add_family(
|
||||||
|
|
@ -1118,8 +1099,6 @@ class ParserVariable:
|
||||||
"type": "any",
|
"type": "any",
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
if version == "1.0" and val["type"] == "suffix":
|
|
||||||
val["type"] = "identifier"
|
|
||||||
param_typ = val["type"]
|
param_typ = val["type"]
|
||||||
val["key"] = key
|
val["key"] = key
|
||||||
val["path"] = path
|
val["path"] = path
|
||||||
|
|
|
||||||
|
|
@ -687,7 +687,6 @@ CALCULATION_TYPES = {
|
||||||
"variable": VariableCalculation,
|
"variable": VariableCalculation,
|
||||||
"information": InformationCalculation,
|
"information": InformationCalculation,
|
||||||
"identifier": IdentifierCalculation,
|
"identifier": IdentifierCalculation,
|
||||||
"suffix": IdentifierCalculation,
|
|
||||||
"index": IndexCalculation,
|
"index": IndexCalculation,
|
||||||
}
|
}
|
||||||
CALCULATION_PROPERTY_TYPES = {
|
CALCULATION_PROPERTY_TYPES = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue