Skip to content
Permalink
Browse files

[sextante]changed how grass help files are found.

Now there's no need to set the help folder, it will look for html pages online instead
  • Loading branch information
volaya committed Apr 11, 2013
1 parent 6618146 commit 207da3631efd42271732a0f505b0b9af371abbe2
@@ -78,13 +78,7 @@ def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../images/grass.png")

def helpFile(self):
folder = GrassUtils.grassHelpPath()
helpfile = str(folder) + os.sep + self.grassName + ".html"
if os.path.exists(helpfile):
return helpfile
else:
raise WrongHelpFileException("Grass help folder is not correctly configured.\nPlease configure it")
#return None
return 'http://grass.osgeo.org/grass64/manuals/' + self.grassName + ".html"

def getParameterDescriptions(self):
descs = {}
@@ -46,15 +46,13 @@ def initializeSettings(self):
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_FOLDER, "GRASS folder", GrassUtils.grassPath()))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_WIN_SHELL, "Msys folder", GrassUtils.grassWinShell()))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_COMMANDS, "Log execution commands", False))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_HELP_FOLDER, "GRASS help folder", GrassUtils.grassHelpPath()))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))

def unload(self):
AlgorithmProvider.unload(self)
if SextanteUtils.isWindows() or SextanteUtils.isMac():
SextanteConfig.removeSetting(GrassUtils.GRASS_FOLDER)
SextanteConfig.removeSetting(GrassUtils.GRASS_WIN_SHELL)
SextanteConfig.removeSetting(GrassUtils.GRASS_HELP_FOLDER)
SextanteConfig.removeSetting(GrassUtils.GRASS_WIN_SHELL)
SextanteConfig.removeSetting(GrassUtils.GRASS_LOG_COMMANDS)
SextanteConfig.removeSetting(GrassUtils.GRASS_LOG_CONSOLE)

@@ -43,8 +43,7 @@ class GrassUtils:
GRASS_REGION_XMAX = "GRASS_REGION_XMAX"
GRASS_REGION_YMAX = "GRASS_REGION_YMAX"
GRASS_REGION_CELLSIZE = "GRASS_REGION_CELLSIZE"
GRASS_FOLDER = "GRASS_FOLDER"
GRASS_HELP_FOLDER = "GRASS_HELP_FOLDER"
GRASS_FOLDER = "GRASS_FOLDER"
GRASS_WIN_SHELL = "GRASS_WIN_SHELL"
GRASS_LOG_COMMANDS = "GRASS_LOG_COMMANDS"
GRASS_LOG_CONSOLE = "GRASS_LOG_CONSOLE"
@@ -94,21 +93,6 @@ def grassPath():

return folder

@staticmethod
def grassHelpPath():
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
if folder == None or folder == "":
if SextanteUtils.isWindows() or SextanteUtils.isMac():
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
def grassWinShell():
folder = SextanteConfig.getSetting(GrassUtils.GRASS_WIN_SHELL)

0 comments on commit 207da36

Please sign in to comment.
You can’t perform that action at this time.