Feature request #2562

Two fixes to utils.py

Added by Chris Crook over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Low
Assignee:Borys Jurgiel
Category:Python plugins
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:12622

Description

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

utils_fixes.diff Magnifier (1.41 KB) Chris Crook, 2010-03-17 03:29 PM

History

#1 Updated by Borys Jurgiel over 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Implemented in and e5fb2d37 (SVN r13101). The utils.showPluginHelp() looks for the help file in the following order:

1. index-ll_CC.html
2. index-ll.html
3. index-en.html
4. index-en_US.html

Also available in: Atom PDF