[GRASS-SVN] r53532 - grass/branches/releasebranch_6_4/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 23 11:53:13 PDT 2012


Author: martinl
Date: 2012-10-23 11:53:12 -0700 (Tue, 23 Oct 2012)
New Revision: 53532

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py
Log:
bugfix #1769


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py	2012-10-23 18:45:42 UTC (rev 53531)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py	2012-10-23 18:53:12 UTC (rev 53532)
@@ -786,7 +786,7 @@
             self.goutput = None
         
         self.manual_tab = HelpPanel(parent = self, grass_command = self.task.name)
-        if not self.manual_tab.IsFile():
+        if not self.manual_tab.GetFile():
             self.manual_tab.Hide()
         else:
             self.notebook.AddPage(page = self.manual_tab, text = _("Manual"), name = 'manual')

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py	2012-10-23 18:45:42 UTC (rev 53531)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py	2012-10-23 18:53:12 UTC (rev 53532)
@@ -887,13 +887,26 @@
     def LoadPage(self, path = None):
         """!Load page"""
         if not path:
-            path = os.path.join(self.content.fspath, self.grass_command + ".html")
+            path = self.GetFile()
         self.content.history.append(path)
         self.content.LoadPage(path)
         
-    def IsFile(self):
-        """!Check if file exists"""
-        return os.path.isfile(os.path.join(self.content.fspath, self.grass_command + ".html"))
+    def GetFile(self):
+        """!Get HTML file"""
+        fMan = os.path.join(self.content.fspath, self.grass_command + ".html")
+        if os.path.isfile(fMan):
+            return fMan
+        
+        # check also addons
+        aPath = os.getenv('GRASS_ADDON_PATH')
+        if aPath:
+            for path in aPath.split(os.pathsep):
+                faMan = os.path.join(path, "docs", "html",
+                                     self.grass_command + ".html")
+                if os.path.isfile(faMan):
+                    return faMan
+        
+        return None
 
     def IsLoaded(self):
         return self.content.loaded



More information about the grass-commit mailing list