author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 11:08:20 +0000 (12:08 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 11:08:20 +0000 (12:08 +0100) |
Conflicts:
src/collectd.conf.in
src/python.c
src/collectd.conf.in
src/python.c
1 | 2 | |||
---|---|---|---|---|
README | patch | | diff1 | | diff2 | | blob | history |
configure.in | patch | | diff1 | | diff2 | | blob | history |
src/collectd-python.pod | patch | | diff1 | | diff2 | | blob | history |
src/collectd.h | patch | | diff1 | | diff2 | | blob | history |
src/curl_json.c | patch | | diff1 | | diff2 | | blob | history |
src/netapp.c | patch | | diff1 | | diff2 | | blob | history |
src/network.c | patch | | diff1 | | diff2 | | blob | history |
src/python.c | patch | | diff1 | | diff2 | | blob | history |
src/utils_match.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc README
Simple merge
diff --cc configure.in
Simple merge
diff --cc src/collectd-python.pod
Simple merge
diff --cc src/collectd.h
Simple merge
diff --cc src/curl_json.c
Simple merge
diff --cc src/netapp.c
Simple merge
diff --cc src/network.c
Simple merge
diff --cc src/python.c
index 8772cd1fc23623d52f8ab8d96042ee86b18bc2bb,16de81d414b1b8ca55867f99fb3b0f77e02e361c..c056b5bf076ebee47b4490ff033a204dbf8f922e
--- 1/src/python.c
--- 2/src/python.c
+++ b/src/python.c
return item;
}
+#ifdef IS_PY3K
+static struct PyModuleDef collectdmodule = {
+ PyModuleDef_HEAD_INIT,
+ "collectd", /* name of module */
+ "The python interface to collectd", /* module documentation, may be NULL */
+ -1,
+ cpy_methods
+};
+
+PyMODINIT_FUNC PyInit_collectd(void) {
+ return PyModule_Create(&collectdmodule);
+}
+#endif
+
static int cpy_config(oconfig_item_t *ci) {
int i;
+ char *argv = "";
PyObject *sys, *tb;
PyObject *sys_path;
PyObject *module;
cpy_log_exception("python initialization");
return 1;
}
+ PySys_SetArgv(1, &argv);
+ PyList_SetSlice(sys_path, 0, 1, NULL);
+
+#ifdef IS_PY3K
+ module = PyImport_ImportModule("collectd");
+#else
module = Py_InitModule("collectd", cpy_methods); /* Borrowed reference. */
+#endif
PyModule_AddObject(module, "Config", (void *) &ConfigType); /* Steals a reference. */
PyModule_AddObject(module, "Values", (void *) &ValuesType); /* Steals a reference. */
PyModule_AddObject(module, "Notification", (void *) &NotificationType); /* Steals a reference. */
diff --cc src/utils_match.c
Simple merge