I've let my love of shiny new QGIS plugins get the better of me, and I'm finding it difficult to remember which menu / submenu / panel that a given plugin is in. I'm using well over 100 now, and going on a purge usually means I find another use for the plugin I just removed...
So I thought I'd try to write a plugin to get that info so I could search for it. Things that the Plugin manager knows, plus (most importantly) how to locate it in the GUI.
Processing is great for finding a lot of the built-in QGIS functionality, but it doesn't find plugins which weren't written to make use of its framework.
Looking at the answer to listing installed plugins via pyqgis I was able to get a list of plugin names.
There seems to be a class, QgsPluginRegistry
, which looks promising in the C++ code, but I can't find a SIP definition file for that, so I don't think this class is exposed to Python.
Using a bit of tracing through the QGIS source, I was able to write a short snippet to sniff the configuration files for the plugins
for x in qgis.utils.findPlugins("/home/steven/.qgis2/python/plugins"):
# gets a (name,ConfigParser) tuple
print "_"*80
print x[0] # plugin name
for key in x[1].options('general'):
print "\t%s = %s" % (key, x[1].get('general',key))
This gives me access to the same info as the QGIS Plugin Manager... changelogs, authorship, category and so on.
qgsAffine
name = Affine Transformations
qgisminimumversion = 2.0
description = Apply affine transformations to selected geometries.
version = 1.0.2
author = Mauricio de Paulo and Erik Timmers
email = [redacted]
changelog = [snipped]
experimental = False
deprecated = False
tags =
homepage = [redacted]
repository = [redacted]
tracker = [redacted]
icon = icon.svg
category = Vector
What it doesn't tell me is where, exactly, is it in the menu structure? Can this be got from PyQGIS in a clean way?
Or to find this, do I need to start sniffing round the Qt GUI classes or writing python parsers (doable, but seems a bit over the top?) The category value (vector, raster etc) helps narrow the search, but there are plenty of plugins (e.g. MMQGIS) which create their own menus.