Opened 6 years ago

Last modified 6 years ago

#3583 new enhancement

g.search.modules to include addons

Reported by: Nikos Alexandris Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Python Version: svn-trunk
Keywords: g.search.modules Cc:
CPU: Unspecified Platform: Unspecified

Description

Currently, the search considers only the module_items.xml file (https://trac.osgeo.org/grass/browser/grass/trunk/scripts/g.search.modules/g.search.modules.py#L197).

Would it make sense for g.search.modules to search also for installed addons? Perhaps by including the $GRASS_ADDON_BASE/modules.xml or(/and?) $GRASS_ADDON_PATH/modules.xml file, in case this file exists.

Change History (8)

comment:1 by Nikos Alexandris, 6 years ago

No progress, just an idea:

if os.getenv("GRASS_ADDON_BASE"):
      ADDON_BASE = os.getenv("GRASS_ADDON_BASE")
      addons_xml = os.path.join(ADDON_BASE, 'modules.xml')
      addons_xml_file = open(addons_xml, 'r')
      addons_descriptions = etree.parse(addons_xml_file)
      addons_xml.close()

See: https://stackoverflow.com/a/14879370/11723. Would it make sense to merge the two xml trees?

comment:2 by neteler, 6 years ago

Component: DefaultPython
Keywords: g.search.modules added
Milestone: 7.6.1
Priority: minornormal
Version: unspecifiedsvn-trunk

Indeed, it would be important to have the addon pages included as well.

Nikos, does your proposed patch work?

comment:3 by neteler, 6 years ago

dupe of #3624 ?

in reply to:  3 comment:4 by Nikos Alexandris, 6 years ago

Replying to neteler:

dupe of #3624 ?

No. #3624 is about listing everything altogether (excluding addons), as in ls *. I was looking for a way to list all core GRASS GIS modules at once. It might be required/useful.

Also, an example for the current ticket #3583:

→ g.search.modules keyword=raster,buffer -ca

r.buffer
    keywords: raster,buffer
    description: Creates a raster map showing buffer zones
                 surrounding cells that contain non-NULL category values.

r.buffer.lowmem
    keywords: raster,buffer
    description: Creates a raster map showing buffer zones
                 surrounding cells that contain non-NULL category values. This
                 is the low-memory alternative to the classic r.buffer
                 module.

r.circle
    keywords: raster,buffer,geometry,circle
    description: Creates a raster map containing concentric rings
                 around a given point.

In my system, I have also installed https://grass.osgeo.org/grass74/manuals/addons/v.rast.bufferstats.html which also features the requested keywords raster and buffer but is, obviously, not reported.

Last edited 6 years ago by Nikos Alexandris (previous) (diff)

comment:5 by Nikos Alexandris, 6 years ago

See also #3751.

comment:6 by martinl, 6 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

comment:7 by AnikaBettge, 6 years ago

I add all installed addons to the list:https://github.com/GRASS-GIS/grass-ci/pull/11

Metamodules like r.modis, r.sim, i.sentinel (and all i.sentinel.... modules) are not listed cause they do not appear with description and keywords in the xml file.

comment:8 by neteler, 6 years ago

Replying to AnikaBettge:

I add all installed addons to the list:https://github.com/GRASS-GIS/grass-ci/pull/11

Thanks, merged in r74379.

Metamodules like r.modis, r.sim, i.sentinel (and all i.sentinel.... modules) are not listed cause they do not appear with description and keywords in the xml file.

Confirmed, this doesn't give any result yet:

g.extension i.sentinel
g.search.modules keyword=sentinel

... added as a bug in #3177.

Note: See TracTickets for help on using tickets.