summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/python/mod-python.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-17 04:14:31 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-17 04:14:31 +0000
commit00438314438f3dde00b532ac5d8d28ccc35c7096 (patch)
tree80dbbb010c5125455a164c77670b8694231f123f /sca-cpp/trunk/modules/python/mod-python.hpp
parent50063bc212e8e93d014519ef0e4d4cabef0b6be2 (diff)
Working queue and chat components. Added a few useful start/stop scripts. Fixed lifecycle code to call start/stop/restart functions before APR pools are cleaned up in both parent and child processes. Minor build script improvements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@910819 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/python/mod-python.hpp')
-rw-r--r--sca-cpp/trunk/modules/python/mod-python.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/sca-cpp/trunk/modules/python/mod-python.hpp b/sca-cpp/trunk/modules/python/mod-python.hpp
index cbe2b6b97c..d13f2227ab 100644
--- a/sca-cpp/trunk/modules/python/mod-python.hpp
+++ b/sca-cpp/trunk/modules/python/mod-python.hpp
@@ -34,7 +34,6 @@
#include "value.hpp"
#include "monad.hpp"
#include "eval.hpp"
-#include "../server/mod-eval.hpp"
namespace tuscany {
namespace server {
@@ -51,11 +50,10 @@ struct applyImplementation {
const value operator()(const list<value>& params) const {
const value expr = append<value>(params, px);
debug(expr, "modeval::python::applyImplementation::input");
- const failable<value> val = python::evalScript(expr, impl);
+ const failable<value> res = python::evalScript(expr, impl);
+ const value val = !hasContent(res)? mklist<value>(value(), reason(res)) : mklist<value>(content(res));
debug(val, "modeval::python::applyImplementation::result");
- if (!hasContent(val))
- return mklist<value>(value(), reason(val));
- return mklist<value>(content(val));
+ return val;
}
};
@@ -63,7 +61,7 @@ struct applyImplementation {
* Evaluate a Python component implementation and convert it to an applicable
* lambda function.
*/
-const failable<lambda<value(const list<value>&)> > evalImplementation(const string& path, const value& impl, const list<value>& px, unused modeval::ServerConf& sc) {
+const failable<lambda<value(const list<value>&)> > evalImplementation(const string& path, const value& impl, const list<value>& px) {
const string fpath(path + attributeValue("script", impl));
ifstream is(fpath);
if (fail(is))