Skip to content

Commit 0c1de04

Browse files
Rashad Kanavathnyalldawson
authored andcommittedFeb 22, 2019
[review] fix issues from code review
1 parent 8e78d20 commit 0c1de04

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed
 

‎images/themes/default/providerOtb.png

-14.6 KB
Binary file not shown.

‎images/themes/default/providerOtb.svg

Lines changed: 1 addition & 0 deletions
Loading

‎python/plugins/processing/algs/otb/OtbAlgorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self, group, name, descriptionfile, display_name='', groupId=''):
6666
self.defineCharacteristicsFromFile()
6767

6868
def icon(self):
69-
return QgsApplication.getThemeIcon("/providerOtb.png")
69+
return QgsApplication.getThemeIcon("/providerOtb.svg")
7070

7171
def createInstance(self):
7272
return self.__class__(self._group, self._name, self._descriptionfile)

‎python/plugins/processing/algs/otb/OtbAlgorithmProvider.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def __init__(self):
5353
self.algs = []
5454
#!hack for 6.6!#
5555
self.version = '6.6.0'
56-
self.descriptionFile = ''
5756

5857
def load(self):
5958
group = self.name()
@@ -118,16 +117,16 @@ def createAlgsList(self):
118117
line = lines.readline().strip('\n').strip()
119118
while line != '' and not line.startswith('#'):
120119
data = line.split('|')
121-
self.descriptionFile = self.descrFile(folder, str(data[1]) + '.txt')
120+
descriptionFile = self.descrFile(folder, str(data[1]) + '.txt')
122121
group, name = str(data[0]), str(data[1])
123122
if name not in alg_names:
124-
algs.append(OtbAlgorithm(group, name, self.descriptionFile))
123+
algs.append(OtbAlgorithm(group, name, descriptionFile))
125124
#avoid duplicate algorithms from algs.txt file (possible but rare)
126125
alg_names.append(name)
127126
line = lines.readline().strip('\n').strip()
128127
except Exception as e:
129128
import traceback
130-
errmsg = "Could not open OTB algorithm from file: \n" + self.descriptionFile + "\nError:\n" + traceback.format_exc()
129+
errmsg = "Could not open OTB algorithm from file: \n" + descriptionFile + "\nError:\n" + traceback.format_exc()
131130
QgsMessageLog.logMessage(self.tr(errmsg), self.tr('Processing'), Qgis.Critical)
132131
return algs
133132

@@ -301,12 +300,8 @@ def descrFile(self, d, f):
301300
return os.path.join(self.descrFolder(d), f)
302301

303302
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)
308303
app_dirs = []
309-
for f in folders:
304+
for f in v.split(';'):
310305
if f is not None and os.path.exists(f):
311306
app_dirs.append(self.normalize_path(f))
312307
return app_dirs
@@ -327,7 +322,7 @@ def supportsNonFileBasedOutput(self):
327322
return False
328323

329324
def icon(self):
330-
return QgsApplication.getThemeIcon("/providerOtb.png")
325+
return QgsApplication.getThemeIcon("/providerOtb.svg")
331326

332327
def tr(self, string, context=''):
333328
if context == '':

0 commit comments

Comments
 (0)
Please sign in to comment.