From 651aeec75b64cc2369adfa2bfc21b2b204e1ab39 Mon Sep 17 00:00:00 2001 From: Elvish_Hunter Date: Wed, 1 Nov 2017 10:59:21 +0100 Subject: [PATCH] wmlscope: fixed a bug that caused UMC map paths to not be found Due to the new regex used, the tilde before UMC paths was now collected but never removed from the paths. --- data/tools/wesnoth/wmltools3.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/data/tools/wesnoth/wmltools3.py b/data/tools/wesnoth/wmltools3.py index fc167a0054de1..c60dc8833f2ff 100644 --- a/data/tools/wesnoth/wmltools3.py +++ b/data/tools/wesnoth/wmltools3.py @@ -778,8 +778,11 @@ def __init__(self, dirpath=[], exclude="", warnlevel=0, progress=False): for pattern in split_filenames(match): for name in expand_square_braces(pattern): # Catches maps that look like macro names. - if (name.endswith(".map") or name.endswith(".mask")) and name[0] == '{': - name = name[1:] + if (name.endswith(".map") or name.endswith(".mask")): + if name.startswith("{~"): + name = name[2:] + elif name.startswith("{"): + name = name[1:] if os.sep == "\\": name = name.replace("/", "\\") key = None