[Qgis-user] Opening a .chm file in QGIS using python programming as a QGIS plugin

Vishwadeep Shende vishwadeepshende at gmail.com
Tue Feb 18 20:55:41 PST 2014


Respected Sir,

I want to ask you a query that, how could I open a .chm file (ie. a help
file) in QGIS framework or in a programmers' language you can say how to
call a .chm file using python on a button's click event in QGIS framework.

I have used this code

import os,sys

class Help():
    def help(self):
        os.startfile(
os.getcwd()+"E:/Noise_project/DGNSS/apps/qgis/python/plugins/DGNSS/noise_help.chm")

after that I have used this function to use it on a click event

 QObject.connect(self.help_action, SIGNAL("triggered()"), self.Help)


def Help(self):
        self.help=open_help.Help()


But i am not able to open this file in QGIS, ie. it is not able  to execute
this function.



Another thing is that, I have also tried to open a html file using the same
concept ie. to click a button & open the the file but still it is not even
opening the html file also. As per the instructions provided by the QGIS
official plugin development site. i am providing the link also
http://www.qgis.org/en/docs/pyqgis_developer_cookbook/plugins.html

and this is the Documentation part of plugin which I have also implemented
still it is not working

The documentation for the plugin can be written as HTML help files. The
qgis.utils module provides a function, showPluginHelp() which will open the
help file browser, in the same way as other QGIS help.

The showPluginHelp`() function looks for help files in the same directory
as the calling module. It will look for, in turn, index-ll_cc.html,
index-ll.html, index-en.html, index-en_us.html andindex.html, displaying
whichever it finds first. Here ll_cc is the QGIS locale. This allows
multiple translations of the documentation to be included with the plugin.

The showPluginHelp() function can also take parameters packageName, which
identifies a specific plugin for which the help will be displayed,
filename, which can replace "index" in the names of files being searched,
and section, which is the name of an html anchor tag in the document on
which the browser will be positioned.


so tell me how could I open the file using python, ie. either a html file
or chm file


Thanks & regards
Vishwadeep Shende
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140219/b92e1fa0/attachment.html>


More information about the Qgis-user mailing list