implement _httpapi python module
[pykit.git] / PythonPublisher.cc
index fc29b6f..410f707 100644 (file)
@@ -26,6 +26,8 @@ struct pykit::PythonPublisher::Impl
     Publisher * pythonPublisher;
 };
 
+#define PYTHON_EXTERN_MODULE(module) \
+    extern "C" { void init ## module (); }
 #define PYTHON_PREPARE_IMPORT(module) \
     PyImport_AppendInittab(const_cast<char*>(#module), init ## module)
 
@@ -436,12 +438,15 @@ BOOST_PYTHON_MODULE(_pykit)
         ;
 }
 
+PYTHON_EXTERN_MODULE(_httpapi);
+
 prefix_ pykit::PythonPublisher::PythonPublisher()
     : impl_ (new Impl)
 {
     try {
         PYTHON_PREPARE_IMPORT(_pykit);
         PYTHON_PREPARE_IMPORT(_qt);
+        PYTHON_PREPARE_IMPORT(_httpapi);
         Py_Initialize();
         py::object initModule = py::import("init");
         impl_->mainNamespace = py::extract<py::dict>(initModule.attr("__dict__"));