summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-06-24 21:36:04 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-07-23 11:57:16 +0200
commitedae78481cf0e9cbffe335de1e541821758c5da1 (patch)
tree72e9d7280e6cf9f9a66c0c20f71fd079bd4ebad6
parent385865d6ad7a54ee294b4086d4679747f49cff2e (diff)
downloadastra-edae78481cf0e9cbffe335de1e541821758c5da1.tar.gz
astra-edae78481cf0e9cbffe335de1e541821758c5da1.tar.bz2
astra-edae78481cf0e9cbffe335de1e541821758c5da1.tar.xz
astra-edae78481cf0e9cbffe335de1e541821758c5da1.zip
Log error when running Python plugin algorithm
-rw-r--r--python/astra/plugin.py7
-rw-r--r--src/PluginAlgorithm.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/python/astra/plugin.py b/python/astra/plugin.py
index 891f6c9..bbbc450 100644
--- a/python/astra/plugin.py
+++ b/python/astra/plugin.py
@@ -65,6 +65,13 @@ class base(object):
log.error(str(e))
raise
+ def astra_run(self, its):
+ try:
+ self.run(its)
+ except Exception as e:
+ log.error(str(e))
+ raise
+
def register(name, className):
"""Register plugin with ASTRA.
diff --git a/src/PluginAlgorithm.cpp b/src/PluginAlgorithm.cpp
index a27ce2c..7dcaf68 100644
--- a/src/PluginAlgorithm.cpp
+++ b/src/PluginAlgorithm.cpp
@@ -62,7 +62,7 @@ bool CPluginAlgorithm::initialize(const Config& _cfg){
void CPluginAlgorithm::run(int _iNrIterations){
if(instance==NULL) return;
- PyObject *retVal = PyObject_CallMethod(instance, "run", "i",_iNrIterations);
+ PyObject *retVal = PyObject_CallMethod(instance, "astra_run", "i",_iNrIterations);
if(retVal==NULL) return;
Py_DECREF(retVal);
}