/[ascend]/trunk/pygtk/help.py
ViewVC logotype

Contents of /trunk/pygtk/help.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1590 - (show annotations) (download) (as text)
Thu Aug 9 14:47:47 2007 UTC (13 years, 2 months ago) by jpye
File MIME type: text/x-python
File size: 968 byte(s)
Fixed default web help URL.
Fixed handling of web links on Fedora (needs checking on other Linux)
1 import webbrowser
2 import os.path
3 import platform
4 import config
5
6 class Help:
7 def __init__(self,helproot=None,url=None):
8 print "HELPROOT =",config.HELPROOT
9 self.goonline=False
10
11 if url is not None:
12 self.webhelproot = url
13 self.goonline = True
14 else:
15 self.webhelproot = config.WEBHELPROOT
16
17 if helproot==None:
18 self.helproot = os.path.expanduser(config.HELPROOT)
19 else:
20 self.helproot = helproot
21
22 if not os.path.exists(self.helproot):
23 print "LOCAL HELP FILES NOT FOUND, WILL USE ONLINE COPY"
24 self.goonline = True
25
26 def run(self,topic=None):
27
28 if platform.system()=="Windows":
29 _b = webbrowser.get()
30 else:
31 # tested on Fedora 7:
32 _b = webbrowser.get('firefox')
33
34 if self.goonline:
35 _u = self.webhelproot
36 else:
37 _p = os.path.join(self.helproot)
38 _u = "file://"+_p
39
40 print "OPENING WEB PAGE: %s..." % _u
41 _b.open(_u,autoraise=1);
42 print "BACK FROM WEB CALL"
43
44 if __name__ == "__main__":
45 _h = Help()
46 _h.run()

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22