Skip to content

Commit

Permalink
[sextante]changed how grass help files are found.
Browse files Browse the repository at this point in the history
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 207da36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
8 changes: 1 addition & 7 deletions python/plugins/sextante/grass/GrassAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
6 changes: 2 additions & 4 deletions python/plugins/sextante/grass/GrassAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
18 changes: 1 addition & 17 deletions python/plugins/sextante/grass/GrassUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 207da36

Please sign in to comment.