Opened 16 months ago

Last modified 5 months 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 Changed 13 months ago by Nikos Alexandris

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 Changed 7 months ago by neteler

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 Changed 7 months ago by neteler

dupe of #3624 ?

comment:4 in reply to:  3 Changed 7 months ago by Nikos Alexandris

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 7 months ago by Nikos Alexandris (previous) (diff)

comment:5 Changed 7 months ago by Nikos Alexandris

See also #3751.

comment:6 Changed 6 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

comment:7 Changed 5 months ago by AnikaBettge

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 Changed 5 months ago by neteler

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.