Skip to content
Permalink
Browse files

[review] fix issues from code review

  • Loading branch information
rkanavath authored and nyalldawson committed Feb 22, 2019
1 parent 8e78d20 commit 0c1de0407a117c8b510c273359bd49326d3f35ea
Binary file not shown.

Large diffs are not rendered by default.

@@ -66,7 +66,7 @@ def __init__(self, group, name, descriptionfile, display_name='', groupId=''):
self.defineCharacteristicsFromFile()

def icon(self):
return QgsApplication.getThemeIcon("/providerOtb.png")
return QgsApplication.getThemeIcon("/providerOtb.svg")

def createInstance(self):
return self.__class__(self._group, self._name, self._descriptionfile)
@@ -53,7 +53,6 @@ def __init__(self):
self.algs = []
#!hack for 6.6!#
self.version = '6.6.0'
self.descriptionFile = ''

def load(self):
group = self.name()
@@ -118,16 +117,16 @@ def createAlgsList(self):
line = lines.readline().strip('\n').strip()
while line != '' and not line.startswith('#'):
data = line.split('|')
self.descriptionFile = self.descrFile(folder, str(data[1]) + '.txt')
descriptionFile = self.descrFile(folder, str(data[1]) + '.txt')
group, name = str(data[0]), str(data[1])
if name not in alg_names:
algs.append(OtbAlgorithm(group, name, self.descriptionFile))
algs.append(OtbAlgorithm(group, name, descriptionFile))
#avoid duplicate algorithms from algs.txt file (possible but rare)
alg_names.append(name)
line = lines.readline().strip('\n').strip()
except Exception as e:
import traceback
errmsg = "Could not open OTB algorithm from file: \n" + self.descriptionFile + "\nError:\n" + traceback.format_exc()
errmsg = "Could not open OTB algorithm from file: \n" + descriptionFile + "\nError:\n" + traceback.format_exc()
QgsMessageLog.logMessage(self.tr(errmsg), self.tr('Processing'), Qgis.Critical)
return algs

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

def appDirs(self, v):
#!hack needed for QGIS < 3.2!#
v = v.replace(';', os.pathsep)
#!hack needed for QGIS < 3.2!#
folders = v.split(os.pathsep)
app_dirs = []
for f in folders:
for f in v.split(';'):
if f is not None and os.path.exists(f):
app_dirs.append(self.normalize_path(f))
return app_dirs
@@ -327,7 +322,7 @@ def supportsNonFileBasedOutput(self):
return False

def icon(self):
return QgsApplication.getThemeIcon("/providerOtb.png")
return QgsApplication.getThemeIcon("/providerOtb.svg")

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

0 comments on commit 0c1de04

Please sign in to comment.
You can’t perform that action at this time.