Skip to content

Commit

Permalink
[sextante]Fixed bug in pyculator algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Apr 11, 2013
1 parent 3d1e50c commit 3034a46
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions python/plugins/sextante/algs/FieldPyculator.py
Expand Up @@ -122,8 +122,8 @@ def processAlgorithm(self, progress):
bytecode = compile(code, '<string>', 'exec') bytecode = compile(code, '<string>', 'exec')
except: except:
raise GeoAlgorithmExecutionException("FieldPyculator code execute error\n"+ raise GeoAlgorithmExecutionException("FieldPyculator code execute error\n"+
"Field code block can't be executed! %s \n %s" "Field code block can't be executed! %s \n %s",
(unicode(sys.exc_info()[0].__name__), unicode(sys.exc_info()[1]))) unicode(sys.exc_info()[0].__name__), unicode(sys.exc_info()[1]))


#run #run
features = QGisLayers.features(layer) features = QGisLayers.features(layer)
Expand Down Expand Up @@ -151,17 +151,7 @@ def processAlgorithm(self, progress):
del new_ns[self.RESULT_VAR_NAME] del new_ns[self.RESULT_VAR_NAME]


#exec #exec
#try:
exec bytecode in new_ns exec bytecode in new_ns
#except:
# raise e
#===============================================================
# GeoAlgorithmExecutionException("FieldPyculator code execute error\n"+
# "Field code block can't be executed for feature %s\n%s\n%s" %
# (unicode(sys.exc_info()[0].__name__),
# unicode(sys.exc_info()[1]),
# unicode(feat_id)))
#===============================================================


#check result #check result
if not new_ns.has_key(self.RESULT_VAR_NAME): if not new_ns.has_key(self.RESULT_VAR_NAME):
Expand Down

0 comments on commit 3034a46

Please sign in to comment.