From 658d79c82398289d0598c566667dee8193eb6bbb Mon Sep 17 00:00:00 2001 From: Tomas Zigo <50632337+tmszi@users.noreply.github.com> Date: Thu, 21 Sep 2023 08:10:07 +0200 Subject: [PATCH] g.extension: fix registration addon with module name start with 2 chars (#3168) Addon module name start with db.*, ps.*, r3.*, wx.*, during installation on the OS MS Windows platform. --- scripts/g.extension/g.extension.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/g.extension/g.extension.py b/scripts/g.extension/g.extension.py index 8685ed048ea..d72d6a6075b 100644 --- a/scripts/g.extension/g.extension.py +++ b/scripts/g.extension/g.extension.py @@ -1630,10 +1630,13 @@ def install_extension_win(name): # collect module names and file names module_list = list() + module_name_pattern = re.compile( + r"^([d,g,i,m,p,r,s,t,v]|^db|^ps|^r3|^wx)\..*[\.py,\.exe]$" + ) for r, d, f in os.walk(srcdir): for file in f: # Filter GRASS module name patterns - if re.search(r"^[d,db,g,i,m,p,ps,r,r3,s,t,v,wx]\..*[\.py,\.exe]$", file): + if re.search(module_name_pattern, file): modulename = os.path.splitext(file)[0] module_list.append(modulename) # remove duplicates in case there are .exe wrappers for python scripts