Skip to content

Commit 207da36

Browse files
committed
[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
1 parent 6618146 commit 207da36

3 files changed

Lines changed: 4 additions & 28 deletions

File tree

python/plugins/sextante/grass/GrassAlgorithm.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,7 @@ def getIcon(self):
7878
return QIcon(os.path.dirname(__file__) + "/../images/grass.png")
7979

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

8983
def getParameterDescriptions(self):
9084
descs = {}

python/plugins/sextante/grass/GrassAlgorithmProvider.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ def initializeSettings(self):
4646
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_FOLDER, "GRASS folder", GrassUtils.grassPath()))
4747
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_WIN_SHELL, "Msys folder", GrassUtils.grassWinShell()))
4848
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_COMMANDS, "Log execution commands", False))
49-
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))
50-
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_HELP_FOLDER, "GRASS help folder", GrassUtils.grassHelpPath()))
49+
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))
5150

5251
def unload(self):
5352
AlgorithmProvider.unload(self)
5453
if SextanteUtils.isWindows() or SextanteUtils.isMac():
5554
SextanteConfig.removeSetting(GrassUtils.GRASS_FOLDER)
56-
SextanteConfig.removeSetting(GrassUtils.GRASS_WIN_SHELL)
57-
SextanteConfig.removeSetting(GrassUtils.GRASS_HELP_FOLDER)
55+
SextanteConfig.removeSetting(GrassUtils.GRASS_WIN_SHELL)
5856
SextanteConfig.removeSetting(GrassUtils.GRASS_LOG_COMMANDS)
5957
SextanteConfig.removeSetting(GrassUtils.GRASS_LOG_CONSOLE)
6058

python/plugins/sextante/grass/GrassUtils.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ class GrassUtils:
4343
GRASS_REGION_XMAX = "GRASS_REGION_XMAX"
4444
GRASS_REGION_YMAX = "GRASS_REGION_YMAX"
4545
GRASS_REGION_CELLSIZE = "GRASS_REGION_CELLSIZE"
46-
GRASS_FOLDER = "GRASS_FOLDER"
47-
GRASS_HELP_FOLDER = "GRASS_HELP_FOLDER"
46+
GRASS_FOLDER = "GRASS_FOLDER"
4847
GRASS_WIN_SHELL = "GRASS_WIN_SHELL"
4948
GRASS_LOG_COMMANDS = "GRASS_LOG_COMMANDS"
5049
GRASS_LOG_CONSOLE = "GRASS_LOG_CONSOLE"
@@ -94,21 +93,6 @@ def grassPath():
9493

9594
return folder
9695

97-
@staticmethod
98-
def grassHelpPath():
99-
folder = SextanteConfig.getSetting(GrassUtils.GRASS_HELP_FOLDER)
100-
if folder == None or folder == "":
101-
if SextanteUtils.isWindows() or SextanteUtils.isMac():
102-
testfolders = [os.path.join(GrassUtils.grassPath(), "docs", "html")]
103-
else:
104-
testfolders = ['/usr/share/doc/grass-doc/html']
105-
for f in testfolders:
106-
if os.path.exists(f):
107-
folder = f
108-
break
109-
110-
return folder
111-
11296
@staticmethod
11397
def grassWinShell():
11498
folder = SextanteConfig.getSetting(GrassUtils.GRASS_WIN_SHELL)

0 commit comments

Comments
 (0)