@@ -104,34 +104,14 @@ def getIcon(self):
104104 return self ._icon
105105
106106 def help (self ):
107- localDoc = None
108- html = self .grass7Name + '.html'
109- if system .isWindows ():
110- # For MS-Windows, use the configured GRASS7 path
111- localPath = os .path .join (Grass7Utils .grassPath (), 'docs/html' , html )
112- if os .path .exists (localPath ):
113- localDoc = os .path .abspath (localPath )
114- elif system .isMac ():
115- # For MacOSX official package
116- localPath = os .path .join ('/Applications/GRASS-7.0.app/Contents/MacOS/docs/html' , html )
117- if os .path .exists (localPath ):
118- localDoc = os .path .abspath (localPath )
107+ helpPath = Grass7Utils .grassHelpPath ()
108+ if helpPath == '' :
109+ return False , None
110+
111+ if os .path .exists (helpPath ):
112+ return False , QUrl .fromLocalFile (os .path .join (helpPath , '{}.html' .format (self .grass7Name ))).toString ()
119113 else :
120- # For GNU/Linux distributions
121- searchPaths = ['/usr/share/doc/grass-doc/html' , '/opt/grass/docs/html' ,
122- '/usr/share/doc/grass/docs/html' ]
123- for path in searchPaths :
124- localPath = os .path .join (path , html )
125- if os .path .exists (localPath ):
126- localDoc = os .path .abspath (localPath )
127-
128- # Found the local documentation
129- if localDoc :
130- localDoc = QUrl .fromLocalFile (localDoc ).toString ()
131- return False , localDoc
132-
133- # Return the URL if local doc is not found
134- return False , 'http://grass.osgeo.org/grass70/manuals/' + self .grass7Name + '.html'
114+ return False , helpPath + '{}.html' .format (self .grass7Name )
135115
136116 def getParameterDescriptions (self ):
137117 descs = {}
@@ -195,7 +175,7 @@ def defineCharacteristicsFromFile(self):
195175 elif isinstance (output , OutputVector ):
196176 vectorOutputs += 1
197177 if isinstance (output , OutputHTML ):
198- self .addOutput (OutputFile ("rawoutput" , output .description +
178+ self .addOutput (OutputFile ("rawoutput" , output .description +
199179 " (raw output)" , "txt" ))
200180 line = lines .readline ().strip ('\n ' ).strip ()
201181 except Exception as e :
0 commit comments