[QGIS-Developer] RES: QgsPluginManagerInterface

Jorge Almerio jorgealmerio at yahoo.com.br
Wed Jul 25 14:50:05 PDT 2018


Thank you, very much!

-----Mensagem original-----
De: Borys Jurgiel [mailto:lists at borysjurgiel.pl] 
Enviada em: quarta-feira, 25 de julho de 2018 18:29
Para: qgis-developer at lists.osgeo.org
Cc: Jorge Almerio
Assunto: Re: [QGIS-Developer] QgsPluginManagerInterface

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