diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-04-23 17:21:17 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-04-23 17:21:17 +0200 |
commit | 042d62126a0ca8b6b9d2fb4d417f07691be90536 (patch) | |
tree | 9e43a823767d875bb35f3deb6f60df49bbd26f33 /src/report-python | |
parent | d3da30c4726a193101ee9c17a71c23cf32fa63ca (diff) | |
download | abrt-042d62126a0ca8b6b9d2fb4d417f07691be90536.tar.gz abrt-042d62126a0ca8b6b9d2fb4d417f07691be90536.tar.xz abrt-042d62126a0ca8b6b9d2fb4d417f07691be90536.zip |
mass replace of crash_data with problem_data
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/report-python')
-rw-r--r-- | src/report-python/Makefile.am | 2 | ||||
-rw-r--r-- | src/report-python/__init__.py | 4 | ||||
-rw-r--r-- | src/report-python/common.h | 8 | ||||
-rw-r--r-- | src/report-python/dump_dir.c | 2 | ||||
-rw-r--r-- | src/report-python/problem_data.c (renamed from src/report-python/crash_data.c) | 64 | ||||
-rw-r--r-- | src/report-python/reportmodule.c | 8 | ||||
-rw-r--r-- | src/report-python/run_event.c | 14 | ||||
-rwxr-xr-x | src/report-python/test_full | 6 | ||||
-rwxr-xr-x | src/report-python/test_full2 | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | src/report-python/test_problem_data (renamed from src/report-python/test_crash_data) | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/report-python/test_problem_data2 (renamed from src/report-python/test_crash_data2) | 2 | ||||
-rwxr-xr-x | src/report-python/test_setroubleshoot_example2 | 2 |
12 files changed, 59 insertions, 59 deletions
diff --git a/src/report-python/Makefile.am b/src/report-python/Makefile.am index 94dc3abb..c7b2dd67 100644 --- a/src/report-python/Makefile.am +++ b/src/report-python/Makefile.am @@ -8,7 +8,7 @@ pyreportexec_LTLIBRARIES = _pyreport.la _pyreport_la_SOURCES = \ reportmodule.c \ - crash_data.c \ + problem_data.c \ dump_dir.c \ run_event.c \ common.h diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py index 0b0f5685..1e87dc47 100644 --- a/src/report-python/__init__.py +++ b/src/report-python/__init__.py @@ -108,7 +108,7 @@ def createAlertSignature(component, hashmarkername, hashvalue, summary, alertSig #### return version return _hardcoded_default_version - cd = crash_data() + cd = problem_data() cd.add("component", component) cd.add("hashmarkername", hashmarkername) cd.add("localhash", hashvalue) @@ -126,5 +126,5 @@ def report(cd, io_unused): ### Silmpler alternative: state = run_event_state() #state.logging_callback = logfunc - r = state.run_event_on_crash_data(cd, "report") + r = state.run_event_on_problem_data(cd, "report") return r diff --git a/src/report-python/common.h b/src/report-python/common.h index d6d209e9..c94e8d90 100644 --- a/src/report-python/common.h +++ b/src/report-python/common.h @@ -19,14 +19,14 @@ #include <Python.h> #include "dump_dir.h" -#include "crash_data.h" +#include "problem_data.h" #include "run_event.h" /* exception object */ extern PyObject *ReportError; /* type objects */ -extern PyTypeObject p_crash_data_type; +extern PyTypeObject p_problem_data_type; extern PyTypeObject p_dump_dir_type; extern PyTypeObject p_run_event_state_type; @@ -43,5 +43,5 @@ typedef struct { typedef struct { PyObject_HEAD - crash_data_t *cd; -} p_crash_data; + problem_data_t *cd; +} p_problem_data; diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index c34cc869..e14e68d2 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -1,5 +1,5 @@ /* - On-disk storage of crash dumps + On-disk storage of problem data Copyright (C) 2010 Abrt team Copyright (C) 2010 RedHat inc. diff --git a/src/report-python/crash_data.c b/src/report-python/problem_data.c index 217560e5..ac80362a 100644 --- a/src/report-python/crash_data.c +++ b/src/report-python/problem_data.c @@ -23,38 +23,38 @@ #include "common.h" static void -p_crash_data_dealloc(PyObject *pself) +p_problem_data_dealloc(PyObject *pself) { - p_crash_data *self = (p_crash_data*)pself; - free_crash_data(self->cd); + p_problem_data *self = (p_problem_data*)pself; + free_problem_data(self->cd); self->cd = NULL; self->ob_type->tp_free(pself); } static PyObject * -p_crash_data_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +p_problem_data_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - p_crash_data *self = (p_crash_data *)type->tp_alloc(type, 0); + p_problem_data *self = (p_problem_data *)type->tp_alloc(type, 0); if (self) - self->cd = new_crash_data(); + self->cd = new_problem_data(); return (PyObject *)self; } //static int -//p_crash_data_init(PyObject *pself, PyObject *args, PyObject *kwds) +//p_problem_data_init(PyObject *pself, PyObject *args, PyObject *kwds) //{ // return 0; //} /* -void add_to_crash_data_ext(crash_data_t *crash_data, +void add_to_problem_data_ext(problem_data_t *problem_data, const char *name, const char *content, unsigned flags); */ -static PyObject *p_crash_data_add(PyObject *pself, PyObject *args) +static PyObject *p_problem_data_add(PyObject *pself, PyObject *args) { - p_crash_data *self = (p_crash_data*)pself; + p_problem_data *self = (p_problem_data*)pself; const char *name; const char *content; @@ -66,22 +66,22 @@ static PyObject *p_crash_data_add(PyObject *pself, PyObject *args) */ return NULL; } - add_to_crash_data_ext(self->cd, name, content, flags); + add_to_problem_data_ext(self->cd, name, content, flags); /* every function returns PyObject, to return void we need to do this */ Py_RETURN_NONE; } -/* struct crash_item *get_crash_data_item_or_NULL(crash_data_t *crash_data, const char *key); */ -static PyObject *p_get_crash_data_item(PyObject *pself, PyObject *args) +/* struct problem_item *get_problem_data_item_or_NULL(problem_data_t *problem_data, const char *key); */ +static PyObject *p_get_problem_data_item(PyObject *pself, PyObject *args) { - p_crash_data *self = (p_crash_data*)pself; + p_problem_data *self = (p_problem_data*)pself; const char *key; if (!PyArg_ParseTuple(args, "s", &key)) { return NULL; } - struct crash_item *ci = get_crash_data_item_or_NULL(self->cd, key); + struct problem_item *ci = get_problem_data_item_or_NULL(self->cd, key); if (ci == NULL) { Py_RETURN_NONE; @@ -89,10 +89,10 @@ static PyObject *p_get_crash_data_item(PyObject *pself, PyObject *args) return Py_BuildValue("sI", ci->content, ci->flags); } -/* struct dump_dir *create_dump_dir_from_crash_data(crash_data_t *crash_data, const char *base_dir_name); */ -static PyObject *p_create_dump_dir_from_crash_data(PyObject *pself, PyObject *args) +/* struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name); */ +static PyObject *p_create_dump_dir_from_problem_data(PyObject *pself, PyObject *args) { - p_crash_data *self = (p_crash_data*)pself; + p_problem_data *self = (p_problem_data*)pself; const char *base_dir_name = NULL; if (!PyArg_ParseTuple(args, "|s", &base_dir_name)) { @@ -101,7 +101,7 @@ static PyObject *p_create_dump_dir_from_crash_data(PyObject *pself, PyObject *ar p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); if (!new_dd) return NULL; - struct dump_dir *dd = create_dump_dir_from_crash_data(self->cd, base_dir_name); + struct dump_dir *dd = create_dump_dir_from_problem_data(self->cd, base_dir_name); if (!dd) { PyObject_Del((PyObject*)new_dd); @@ -112,26 +112,26 @@ static PyObject *p_create_dump_dir_from_crash_data(PyObject *pself, PyObject *ar return (PyObject*)new_dd; } -//static PyMemberDef p_crash_data_members[] = { +//static PyMemberDef p_problem_data_members[] = { // { NULL } //}; -static PyMethodDef p_crash_data_methods[] = { +static PyMethodDef p_problem_data_methods[] = { /* method_name, func, flags, doc_string */ - { "add" , p_crash_data_add , METH_VARARGS }, - { "get" , p_get_crash_data_item , METH_VARARGS }, - { "create_dump_dir", p_create_dump_dir_from_crash_data, METH_VARARGS }, + { "add" , p_problem_data_add , METH_VARARGS }, + { "get" , p_get_problem_data_item , METH_VARARGS }, + { "create_dump_dir", p_create_dump_dir_from_problem_data, METH_VARARGS }, { NULL } }; -PyTypeObject p_crash_data_type = { +PyTypeObject p_problem_data_type = { PyObject_HEAD_INIT(NULL) - .tp_name = "report.crash_data", - .tp_basicsize = sizeof(p_crash_data), + .tp_name = "report.problem_data", + .tp_basicsize = sizeof(p_problem_data), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - .tp_new = p_crash_data_new, - .tp_dealloc = p_crash_data_dealloc, - //.tp_init = p_crash_data_init, - //.tp_members = p_crash_data_members, - .tp_methods = p_crash_data_methods, + .tp_new = p_problem_data_new, + .tp_dealloc = p_problem_data_dealloc, + //.tp_init = p_problem_data_init, + //.tp_members = p_problem_data_members, + .tp_methods = p_problem_data_methods, }; diff --git a/src/report-python/reportmodule.c b/src/report-python/reportmodule.c index a684984e..c40cfaf6 100644 --- a/src/report-python/reportmodule.c +++ b/src/report-python/reportmodule.c @@ -36,9 +36,9 @@ static PyMethodDef module_methods[] = { PyMODINIT_FUNC init_pyreport(void) { - if (PyType_Ready(&p_crash_data_type) < 0) + if (PyType_Ready(&p_problem_data_type) < 0) { - printf("PyType_Ready(&p_crash_data_type) < 0\n"); + printf("PyType_Ready(&p_problem_data_type) < 0\n"); return; } if (PyType_Ready(&p_dump_dir_type) < 0) @@ -66,8 +66,8 @@ init_pyreport(void) PyModule_AddObject(m, "error", ReportError); /* init type objects */ - Py_INCREF(&p_crash_data_type); - PyModule_AddObject(m, "crash_data", (PyObject *)&p_crash_data_type); + Py_INCREF(&p_problem_data_type); + PyModule_AddObject(m, "problem_data", (PyObject *)&p_problem_data_type); PyModule_AddObject(m, "CD_FLAG_BIN" , Py_BuildValue("i", CD_FLAG_BIN )); PyModule_AddObject(m, "CD_FLAG_TXT" , Py_BuildValue("i", CD_FLAG_TXT )); PyModule_AddObject(m, "CD_FLAG_ISEDITABLE" , Py_BuildValue("i", CD_FLAG_ISEDITABLE )); diff --git a/src/report-python/run_event.c b/src/report-python/run_event.c index 684c7fc7..50e3794e 100644 --- a/src/report-python/run_event.c +++ b/src/report-python/run_event.c @@ -21,7 +21,7 @@ #include <errno.h> #include "common.h" -#include "crash_data.h" +#include "problem_data.h" #include "run_event.h" typedef struct { @@ -110,17 +110,17 @@ static PyObject *p_run_event_on_dir_name(PyObject *pself, PyObject *args) return obj; } -/* int run_event_on_crash_data(struct run_event_state *state, crash_data_t *data, const char *event); */ -static PyObject *p_run_event_on_crash_data(PyObject *pself, PyObject *args) +/* int run_event_on_problem_data(struct run_event_state *state, problem_data_t *data, const char *event); */ +static PyObject *p_run_event_on_problem_data(PyObject *pself, PyObject *args) { p_run_event_state *self = (p_run_event_state*)pself; - p_crash_data *cd; + p_problem_data *cd; const char *event; - if (!PyArg_ParseTuple(args, "O!s", &p_crash_data_type, &cd, &event)) + if (!PyArg_ParseTuple(args, "O!s", &p_problem_data_type, &cd, &event)) { return NULL; } - int r = run_event_on_crash_data(self->state, cd->cd, event); + int r = run_event_on_problem_data(self->state, cd->cd, event); PyObject *obj = Py_BuildValue("i", r); return obj; } @@ -194,7 +194,7 @@ static int set_logging_callback(PyObject *pself, PyObject *callback, void *unuse static PyMethodDef p_run_event_state_methods[] = { /* method_name, func, flags, doc_string */ { "run_event_on_dir_name" , p_run_event_on_dir_name , METH_VARARGS }, - { "run_event_on_crash_data", p_run_event_on_crash_data, METH_VARARGS }, + { "run_event_on_problem_data", p_run_event_on_problem_data, METH_VARARGS }, { NULL } }; diff --git a/src/report-python/test_full b/src/report-python/test_full index 103535dd..107c4857 100755 --- a/src/report-python/test_full +++ b/src/report-python/test_full @@ -3,7 +3,7 @@ import sys from report import * -def run_event_on_crash_data(cd, event, log_function = None): +def run_event_on_problem_data(cd, event, log_function = None): dd = cd.create_dump_dir("/tmp") dir_name = dd.name print "Created dump_dir:", dir_name @@ -20,8 +20,8 @@ def run_event_on_crash_data(cd, event, log_function = None): def log_function(line): print "LOG:", line -cd = crash_data() +cd = problem_data() cd.add("foo", "bar") cd.add("analyzer", "baz", CD_FLAG_ISNOTEDITABLE) -r = run_event_on_crash_data(cd, "post-create", log_function) +r = run_event_on_problem_data(cd, "post-create", log_function) print "Result:", r diff --git a/src/report-python/test_full2 b/src/report-python/test_full2 index 734946eb..e6cfd4d9 100755 --- a/src/report-python/test_full2 +++ b/src/report-python/test_full2 @@ -6,12 +6,12 @@ from report import * def log_function(line): print "LOG:", line -cd = crash_data() +cd = problem_data() cd.add("foo", "bar") cd.add("analyzer", "baz", CD_FLAG_ISNOTEDITABLE) st = run_event_state() st.logging_callback = log_function -r = st.run_event_on_crash_data(cd, "post-create") +r = st.run_event_on_problem_data(cd, "post-create") print "Result:", r diff --git a/src/report-python/test_crash_data b/src/report-python/test_problem_data index 6f719a8f..16f1f9ae 100755..100644 --- a/src/report-python/test_crash_data +++ b/src/report-python/test_problem_data @@ -2,7 +2,7 @@ from report import * -cd = crash_data() +cd = problem_data() cd.add("foo", "bar") dd = cd.create_dump_dir() diff --git a/src/report-python/test_crash_data2 b/src/report-python/test_problem_data2 index 2594f863..3d3692b9 100755..100644 --- a/src/report-python/test_crash_data2 +++ b/src/report-python/test_problem_data2 @@ -2,7 +2,7 @@ from report import * -cd = crash_data() +cd = problem_data() cd.add("foo", "bar") print "foo:", cd.get("foo") diff --git a/src/report-python/test_setroubleshoot_example2 b/src/report-python/test_setroubleshoot_example2 index 8aebcdfe..b712cda7 100755 --- a/src/report-python/test_setroubleshoot_example2 +++ b/src/report-python/test_setroubleshoot_example2 @@ -22,6 +22,6 @@ def logging_callback(line): return state = report.run_event_state() state.logging_callback = logging_callback -rc = state.run_event_on_crash_data(signature, "report") +rc = state.run_event_on_problem_data(signature, "report") print "rc:", rc |