浏览代码

scripts/g.extension: fix get get_addons_paths func json_file attribute (#2094)

Tomas Zigo 3 年之前
父节点
当前提交
4fead0ac24
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 9 4
      scripts/g.extension/g.extension.py

+ 9 - 4
scripts/g.extension/g.extension.py

@@ -2534,11 +2534,13 @@ def resolve_source_code(url=None, name=None, branch=None, fork=False):
 
 
 def get_addons_paths(gg_addons_base_dir):
-    """Get and save extensions paths as 'extensions_paths.json' json file
-    in the $GRASS_ADDON_BASE dir. The file serves as a list of all addons,
-    and their paths (mkhmtl.py tool)
+    """Get and save addons paths from GRASS GIS Addons GitHub repo API
+    as 'addons_paths.json' file in the gg_addons_base_dir. The file
+    serves as a list of all addons, and their paths (required for
+    mkhmtl.py tool)
+
+    :param str gg_addons_base_dir: dir path where addons are installed
     """
-    get_addons_paths.json_file = "addons_paths.json"
     # Define branch to fetch from (latest or current version)
     addons_branch = get_version_branch(version[0])
     url = f"https://api.github.com/repos/OSGeo/grass-addons/git/trees/{addons_branch}?recursive=1"
@@ -2555,6 +2557,9 @@ def get_addons_paths(gg_addons_base_dir):
             json.dump(addons_paths, f)
 
 
+get_addons_paths.json_file = "addons_paths.json"
+
+
 def main():
     # check dependencies
     if not flags["a"] and sys.platform != "win32":