Compare commits

..

No commits in common. "75b5c0cde0abdf83f968dbfb54950a4fc10a3d2b" and "e9f6f3dc7c499473adb04d0ea3c9c335029ae094" have entirely different histories.

View File

@ -45,34 +45,25 @@ def _update_for_base(
logger.debug("Pattern too short, continue!") logger.debug("Pattern too short, continue!")
continue continue
tag = ( tag = (
re.search(r":\[(.*)\]", line).group(1).strip() re.match(r":\[(.*)\]$", line).group().strip()
if re.search(r":\[(.*)\]", line) is not None if re.match(r":\[(.*)\]$", line)
else "" else ""
) )
for line in filter(
for xml_file in filter( lambda line:
lambda xml_file:
# Matches glob pattern # Matches glob pattern
fnmatch.fnmatchcase(str(xml_file), pattern) fnmatch.fnmatchcase(str(line), pattern)
# contains tag if tag in pattern # contains tag if tag in pattern
and ( and (
any( etree.parse(file).find(f"//tag[@key='{tag}']")
map(
lambda xml_file_with_ending: etree.parse(
xml_file_with_ending
).find(f".//tag[@key='{tag}']")
is not None,
xml_file.parent.glob(f"{xml_file.name}.*.xml"),
)
)
if tag != "" if tag != ""
else True else True
) )
# Not just matching an empty xml_file # Not just matching an empty line
and len(str(xml_file)) > 0, and len(str(line)) > 0,
all_xml, all_xml,
): ):
matching_files.add(str(xml_file)) matching_files.add(str(line))
for file in Path("").glob(f"{base}.??.xhtml"): for file in Path("").glob(f"{base}.??.xhtml"):
xslt_root = etree.parse(file) xslt_root = etree.parse(file)