[QGIS-Developer] QgsPluginManagerInterface

Borys Jurgiel lists at borysjurgiel.pl
Wed Jul 25 14:28:40 PDT 2018


Hi,

QgsPluginManagerInterface is quite limited. Try this instead:

from qgis.utils import pluginMetadata
pluginMetadata('myPluginName', 'version')

For more info see https://github.com/qgis/QGIS/blob/master/python/utils.py#L290

Regards,
Borys


Dnia środa, 25 lipca 2018 18:30:26 CEST Jorge Almerio pisze:
> Hi devs,
> 
> 
> 
> I need to get the current version (in metadata.txt) of my plugin from
> python. I saw that there is a Class
> <https://qgis.org/pyqgis/master/gui/other/QgsPluginManagerInterface.html>
> to access Metadata, but I did not found any example how to use it.
> 
> I tried with the code below without success. Does anyone can help me?
> 
> 
> 
> from qgis.gui import QgsPluginManagerInterface
> 
> meta = QgsPluginManagerInterface.pluginMetadata('myPluginName')
> 
> print(meta)
> 
> 
> 
> Thanks is advance!






More information about the QGIS-Developer mailing list