summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/python/mod-python.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-29 03:19:48 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-29 03:19:48 +0000
commit163a913a226cca335544231da5051562891c286b (patch)
treed7a3dbe8f0866575a356966a39a389396011f54c /sca-cpp/trunk/modules/python/mod-python.hpp
parent88bf2a256b02e1858993bf097f4dc743d389e3f0 (diff)
Make sure components execute in the correct contribution directory and fix support for Python relative module imports.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@990483 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.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/sca-cpp/trunk/modules/python/mod-python.hpp b/sca-cpp/trunk/modules/python/mod-python.hpp
index d13f2227ab..0121779530 100644
--- a/sca-cpp/trunk/modules/python/mod-python.hpp
+++ b/sca-cpp/trunk/modules/python/mod-python.hpp
@@ -62,11 +62,12 @@ struct applyImplementation {
* lambda function.
*/
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));
+ const string spath(attributeValue("script", impl));
+ const string fpath(path + spath);
ifstream is(fpath);
if (fail(is))
return mkfailure<lambda<value(const list<value>&)> >(string("Could not read implementation: ") + fpath);
- const failable<PyObject*> script = python::readScript(fpath, is);
+ const failable<PyObject*> script = python::readScript(python::moduleName(spath), fpath, is);
if (!hasContent(script))
return mkfailure<lambda<value(const list<value>&)> >(reason(script));
return lambda<value(const list<value>&)>(applyImplementation(content(script), px));