Skip to content

Commit

Permalink
[grass] fix guessing of doc folder for linux
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@115 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
julien.malik@gmail.com committed Apr 17, 2012
1 parent 3765365 commit 1c9ab96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/sextante/grass/GrassAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../images/grass.png")

def helpFile(self):
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
folder = GrassUtils.grassHelpPath()
if str(folder).strip() != "":
helpfile = str(folder) + os.sep + self.name + ".html"
return helpfile
Expand Down
16 changes: 13 additions & 3 deletions src/sextante/grass/GrassUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def grassScriptFilename():

@staticmethod
def grassPath():
if not SextanteUtils.isWindows():
return ""

folder = SextanteConfig.getSetting(GrassUtils.GRASS_FOLDER)
if folder == None:
folder = plugin_installer.__file__
Expand All @@ -53,9 +56,16 @@ def grassPath():
@staticmethod
def grassHelpPath():
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
if folder == None:
folder = os.path.join(GrassUtils.grassPath(), "docs", "html")

if folder is None:
if SextanteUtils.isWindows():
testfolders = os.path.join(GrassUtils.grassPath(), "docs", "html")
else:
testfolders = ['/usr/share/doc/grass-doc/html']
for f in testfolders:
if os.path.exists(f):
folder = f
break

return folder

@staticmethod
Expand Down

0 comments on commit 1c9ab96

Please sign in to comment.