summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/python/mod-python.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/python/mod-python.cpp')
-rw-r--r--sca-cpp/trunk/modules/python/mod-python.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/sca-cpp/trunk/modules/python/mod-python.cpp b/sca-cpp/trunk/modules/python/mod-python.cpp
index df94f2e8a1..8561a1fbf4 100644
--- a/sca-cpp/trunk/modules/python/mod-python.cpp
+++ b/sca-cpp/trunk/modules/python/mod-python.cpp
@@ -37,40 +37,27 @@ namespace server {
namespace modeval {
/**
- * Start the module.
+ * Apply a lifecycle start or restart event.
*/
-const failable<bool> start(unused ServerConf& sc) {
- // Start a Python runtime
- sc.moduleConf = new (gc_new<python::PythonRuntime>()) python::PythonRuntime();
- return true;
-}
+const value applyLifecycle(unused const list<value>& params) {
-/**
- * Stop the module.
- */
-const failable<bool> stop(unused ServerConf& sc) {
- return true;
-}
+ // Create a Python runtime
+ new (gc_new<python::PythonRuntime>()) python::PythonRuntime();
-/**
- * Restart the module.
- */
-const failable<bool> restart(unused ServerConf& sc) {
- // Start a Python runtime
- sc.moduleConf = new (gc_new<python::PythonRuntime>()) python::PythonRuntime();
- return true;
+ // Return a nil function as we don't need to handle the stop event
+ return failable<value>(lambda<value(const list<value>&)>());
}
/**
* 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, modeval::ServerConf& sc) {
+const failable<lambda<value(const list<value>&)> > evalImplementation(const string& path, const value& impl, const list<value>& px, unused const lambda<value(const list<value>&)>& lifecycle) {
const string itype(elementName(impl));
if (contains(itype, ".python"))
- return modpython::evalImplementation(path, impl, px, sc);
+ return modpython::evalImplementation(path, impl, px);
if (contains(itype, ".cpp"))
- return modcpp::evalImplementation(path, impl, px, sc);
+ return modcpp::evalImplementation(path, impl, px);
return mkfailure<lambda<value(const list<value>&)> >(string("Unsupported implementation type: ") + itype);
}