summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bdc0706)
raw | patch | inline | side by side (parent: bdc0706)
author | Sven Trenkel <collectd@semidefinite.de> | |
Fri, 1 Oct 2010 00:41:38 +0000 (02:41 +0200) | ||
committer | Sven Trenkel <collectd@semidefinite.de> | |
Fri, 1 Oct 2010 00:41:38 +0000 (02:41 +0200) |
src/collectd-python.pod | patch | blob | history | |
src/python.c | patch | blob | history |
index 45a06d1d34713d7933ee13607f9913955ec186c7..cbfd26728b28b540acdc949c978cd1f03e2f597b 100644 (file)
--- a/src/collectd-python.pod
+++ b/src/collectd-python.pod
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
=head1 NAME
collectd-python - Documentation of collectd's C<python plugin>
diff --git a/src/python.c b/src/python.c
index 384ca8b759af7fae3cd9dc0d203cd5d98f966354..16de81d414b1b8ca55867f99fb3b0f77e02e361c 100644 (file)
--- a/src/python.c
+++ b/src/python.c
@@ -892,6 +892,7 @@ static PyObject *cpy_oconfig_to_pyconfig(oconfig_item_t *ci, PyObject *parent) {
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);
+
module = Py_InitModule("collectd", cpy_methods); /* Borrowed reference. */
PyModule_AddObject(module, "Config", (void *) &ConfigType); /* Steals a reference. */
PyModule_AddObject(module, "Values", (void *) &ValuesType); /* Steals a reference. */