[GRASS-SVN] r65852 - grass/trunk/scripts/g.extension

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 7 14:24:12 PDT 2015


Author: wenzeslaus
Date: 2015-08-07 14:24:12 -0700 (Fri, 07 Aug 2015)
New Revision: 65852

Modified:
   grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: fix listing of modules from the official source (uses generated XMLs at grass.osgeo.org)

Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py	2015-08-07 20:06:12 UTC (rev 65851)
+++ grass/trunk/scripts/g.extension/g.extension.py	2015-08-07 21:24:12 UTC (rev 65852)
@@ -305,6 +305,7 @@
 
     For toolboxes it lists also all modules.
     """
+    gscript.debug("list_available_extensions(url={})".format(url))
     if flags['t']:
         grass.message(_("List of available extensions (toolboxes):"))
         tlist = get_available_toolboxes(url)
@@ -1396,6 +1397,7 @@
     >>> resolve_xmlurl_prefix('http://grass.osgeo.org/addons/')
     'http://grass.osgeo.org/addons/'
     """
+    gscript.debug("resolve_xmlurl_prefix(url={}, source={})".format(url, source))
     if source == 'official':
         # use pregenerated modules XML file
         url = 'http://grass.osgeo.org/addons/grass%s/' % version[0]
@@ -1595,7 +1597,12 @@
 
     # list available extensions
     if flags['l'] or flags['c'] or flags['g']:
-        xmlurl = resolve_xmlurl_prefix(options['svnurl'])
+        # using dummy module, we don't need any module URL now,
+        # but will work only as long as the function does not check
+        # if the URL is actually valid or something
+        source, url = resolve_source_code(name='r.dummy',
+                                          url=options['svnurl'])
+        xmlurl = resolve_xmlurl_prefix(options['svnurl'], source=source)
         list_available_extensions(xmlurl)
         return 0
     elif flags['a']:



More information about the grass-commit mailing list