+# 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>
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. */