Skip to content

Commit

Permalink
[processing] move OTB output to INFO tab, fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 26, 2014
1 parent e484500 commit 3bedc70
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/plugins/processing/otb/OTBAlgorithm.py
Expand Up @@ -61,8 +61,8 @@ def __init__(self, descriptionfile):
self.defineCharacteristicsFromFile()
self.numExportedLayers = 0
self.hasROI = None;


def __str__(self):
return( "Algo : " + self.name + " from app : " + self.cliName + " in : " + self.group )

Expand Down Expand Up @@ -114,7 +114,7 @@ def get_list_from_node(self, myet):
rebuild.append(name)
for each in parameter[4:]:
if not each.tag in ["hidden"]:
if len(each.getchildren()) == 0:
if len(list(each)) == 0:
rebuild.append(each.text)
else:
rebuild.append([item.text for item in each.iter('choice')])
Expand All @@ -131,7 +131,7 @@ def defineCharacteristicsFromFile(self):
self.name = dom_model.find('longname').text
self.group = dom_model.find('group').text

ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, "Reading parameters... for %s" % self.appkey)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "Reading parameters for %s" % self.appkey)

rebu = None
the_result = None
Expand Down Expand Up @@ -194,7 +194,7 @@ def processAlgorithm(self, progress):
else :
data = inputParameter[5:]
dataset = data

#on windows, there isn't "
#if data[-1] == '"':
if currentOs == "posix" :
Expand All @@ -209,7 +209,7 @@ def processAlgorithm(self, progress):
else :
#dataset = os.path.basename( data ) + '"' + dataset[dataset.index('://'):]
dataset = dataset[dataset.index('://'):]

#get index of the subdataset with gdal
if currentOs == "posix" :
commandgdal = "gdalinfo " + data + " | grep '" + dataset + "$'"
Expand All @@ -227,15 +227,15 @@ def processAlgorithm(self, progress):
else :
print "Error : no match of ", dataset, "$ in gdalinfo " + data
indexSubdataset = -1


if not indexSubdataset == -1 :
indexSubdataset = int(indexSubdataset) -1
newParam = "\'" + data + "?&sdataidx=" + str(indexSubdataset) + "\'"

else :
newParam = inputParameter

newparams += newParam
# no hdf5
else :
Expand Down Expand Up @@ -343,5 +343,5 @@ def processAlgorithm(self, progress):
for a_frame in frames:
frame,filename,line_number,function_name,lines,index = a_frame
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "%s %s %s %s %s %s" % (frame,filename,line_number,function_name,lines,index))

OTBUtils.executeOtb(commands, progress)

0 comments on commit 3bedc70

Please sign in to comment.