@@ -53,7 +53,6 @@ def __init__(self):
53
53
self .algs = []
54
54
#!hack for 6.6!#
55
55
self .version = '6.6.0'
56
- self .descriptionFile = ''
57
56
58
57
def load (self ):
59
58
group = self .name ()
@@ -118,16 +117,16 @@ def createAlgsList(self):
118
117
line = lines .readline ().strip ('\n ' ).strip ()
119
118
while line != '' and not line .startswith ('#' ):
120
119
data = line .split ('|' )
121
- self . descriptionFile = self .descrFile (folder , str (data [1 ]) + '.txt' )
120
+ descriptionFile = self .descrFile (folder , str (data [1 ]) + '.txt' )
122
121
group , name = str (data [0 ]), str (data [1 ])
123
122
if name not in alg_names :
124
- algs .append (OtbAlgorithm (group , name , self . descriptionFile ))
123
+ algs .append (OtbAlgorithm (group , name , descriptionFile ))
125
124
#avoid duplicate algorithms from algs.txt file (possible but rare)
126
125
alg_names .append (name )
127
126
line = lines .readline ().strip ('\n ' ).strip ()
128
127
except Exception as e :
129
128
import traceback
130
- errmsg = "Could not open OTB algorithm from file: \n " + self . descriptionFile + "\n Error:\n " + traceback .format_exc ()
129
+ errmsg = "Could not open OTB algorithm from file: \n " + descriptionFile + "\n Error:\n " + traceback .format_exc ()
131
130
QgsMessageLog .logMessage (self .tr (errmsg ), self .tr ('Processing' ), Qgis .Critical )
132
131
return algs
133
132
@@ -301,12 +300,8 @@ def descrFile(self, d, f):
301
300
return os .path .join (self .descrFolder (d ), f )
302
301
303
302
def appDirs (self , v ):
304
- #!hack needed for QGIS < 3.2!#
305
- v = v .replace (';' , os .pathsep )
306
- #!hack needed for QGIS < 3.2!#
307
- folders = v .split (os .pathsep )
308
303
app_dirs = []
309
- for f in folders :
304
+ for f in v . split ( ';' ) :
310
305
if f is not None and os .path .exists (f ):
311
306
app_dirs .append (self .normalize_path (f ))
312
307
return app_dirs
@@ -327,7 +322,7 @@ def supportsNonFileBasedOutput(self):
327
322
return False
328
323
329
324
def icon (self ):
330
- return QgsApplication .getThemeIcon ("/providerOtb.png " )
325
+ return QgsApplication .getThemeIcon ("/providerOtb.svg " )
331
326
332
327
def tr (self , string , context = '' ):
333
328
if context == '' :
0 commit comments