mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -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")
|
return QIcon(os.path.dirname(__file__) + "/../images/grass.png")
|
||||||
|
|
||||||
def helpFile(self):
|
def helpFile(self):
|
||||||
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
|
folder = GrassUtils.grassHelpPath()
|
||||||
if str(folder).strip() != "":
|
if str(folder).strip() != "":
|
||||||
helpfile = str(folder) + os.sep + self.name + ".html"
|
helpfile = str(folder) + os.sep + self.name + ".html"
|
||||||
return helpfile
|
return helpfile
|
||||||
|
@ -38,6 +38,9 @@ class GrassUtils:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def grassPath():
|
def grassPath():
|
||||||
|
if not SextanteUtils.isWindows():
|
||||||
|
return ""
|
||||||
|
|
||||||
folder = SextanteConfig.getSetting(GrassUtils.GRASS_FOLDER)
|
folder = SextanteConfig.getSetting(GrassUtils.GRASS_FOLDER)
|
||||||
if folder == None:
|
if folder == None:
|
||||||
folder = plugin_installer.__file__
|
folder = plugin_installer.__file__
|
||||||
@ -53,9 +56,16 @@ class GrassUtils:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def grassHelpPath():
|
def grassHelpPath():
|
||||||
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
|
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
|
||||||
if folder == None:
|
if folder is None:
|
||||||
folder = os.path.join(GrassUtils.grassPath(), "docs", "html")
|
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
|
return folder
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user