Quellcode durchsuchen

g.extension: fix get add-on module name on Win platform (#1143)

(e.g. r.sample.category.py -> r.sample.category)
Tomas Zigo vor 4 Jahren
Ursprung
Commit
ef56e0001c
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      scripts/g.extension/g.extension.py

+ 2 - 2
scripts/g.extension/g.extension.py

@@ -1239,10 +1239,10 @@ def install_extension_win(name):
     for r, d, f in os.walk(srcdir):
     for r, d, f in os.walk(srcdir):
         for file in f:
         for file in f:
             if file.endswith('.py'):
             if file.endswith('.py'):
-                modulename = file.rstrip(".py")
+                modulename = file.rsplit('.py')[0]
                 module_list.append(modulename)
                 module_list.append(modulename)
             if file.endswith('.exe'):
             if file.endswith('.exe'):
-                modulename = file.rstrip(".exe")
+                modulename = file.rsplit('.exe')[0]
                 module_list.append(modulename)
                 module_list.append(modulename)
     # remove duplicates in case there are .exe wrappers for python scripts
     # remove duplicates in case there are .exe wrappers for python scripts
     module_list = set(module_list)
     module_list = set(module_list)