mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[grass] fix guessing of doc folder for linux
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@115 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
This commit is contained in:
parent
3765365254
commit
1c9ab96b25
@ -39,7 +39,7 @@ class GrassAlgorithm(GeoAlgorithm):
|
||||
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
|
||||
|
@ -38,6 +38,9 @@ class GrassUtils:
|
||||
|
||||
@staticmethod
|
||||
def grassPath():
|
||||
if not SextanteUtils.isWindows():
|
||||
return ""
|
||||
|
||||
folder = SextanteConfig.getSetting(GrassUtils.GRASS_FOLDER)
|
||||
if folder == None:
|
||||
folder = plugin_installer.__file__
|
||||
@ -53,9 +56,16 @@ class GrassUtils:
|
||||
@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
|
||||
|
Loading…
x
Reference in New Issue
Block a user