[QGIS-trac] [Quantum GIS] #2562: Two fixes to utils.py

Quantum GIS qgis at qgis.org
Wed Mar 17 18:28:49 EDT 2010


#2562: Two fixes to utils.py
-------------------------------------------+--------------------------------
   Reporter:  ccrook                       |              Owner:  borysiasty   
       Type:  patch                        |             Status:  new          
   Priority:  minor: annoyance             |          Milestone:  Version 1.5.0
  Component:  Python plugins and bindings  |            Version:  HEAD         
   Keywords:                               |   Platform_version:               
   Platform:  Debian                       |           Must_fix:  No           
Status_info:  0                            |  
-------------------------------------------+--------------------------------
 This patch makes two changes to utils.py.

 1) updates the canUninstallPlugin function to provide a bit more
 robustness, in particular to allow the plugin to be uninstalled if its
 canBeUninstalled function throws an exception.

 2) adds a new function showPluginHelp.  This is designed to be called from
 a plugin, using

     from qgis import utils
     utils.showPluginHelp()

 This will open a help file in the plugin directory in the users browser.
 It will first look for index-ll.html, where ll is the major locale, and if
 it doesn't find that, will try index.html.  This allows for multiple
 language versions of the help file.  It has optional parameters to replace
 "index" with an alternative helpfile name, and to append an html anchor to
 the url to jump to directly to a section of the helpfile.

 The function can also be called specifying a package name, e.g.
      utils.showPluginHelp("MyFavouritePlugin")

 The intention of this is to provide a simple common way for python plugins
 to supply documentation

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2562>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list