diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-15 18:44:55 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-15 18:44:55 +0100 |
| commit | 6a2b728d7525214402eff838bb37be175ddce6c3 (patch) | |
| tree | 2a9608f3c9922531a04ced1bbafa6502b10ffe59 /src/report-python | |
| parent | a10b0fa6bba8218a82d634100947e084ca8d6a36 (diff) | |
| download | abrt-6a2b728d7525214402eff838bb37be175ddce6c3.tar.gz abrt-6a2b728d7525214402eff838bb37be175ddce6c3.tar.xz abrt-6a2b728d7525214402eff838bb37be175ddce6c3.zip | |
Rename foo_crash_dump_dir -> foo_dump_dir
To be exact, these three functions are renamed:
load_crash_data_from_crash_dump_dir
create_crash_dump_dir
delete_crash_dump_dir
Rationale: data structure is called "struct dump_dir", not
"struct crash_dump_dir"
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/report-python')
| -rw-r--r-- | src/report-python/crash_dump.c | 37 | ||||
| -rw-r--r-- | src/report-python/dump_dir.c | 4 | ||||
| -rw-r--r-- | src/report-python/reportmodule.c | 6 | ||||
| -rwxr-xr-x | src/report-python/test_crash_data | 2 |
4 files changed, 16 insertions, 33 deletions
diff --git a/src/report-python/crash_dump.c b/src/report-python/crash_dump.c index 868e97ec..63f390b2 100644 --- a/src/report-python/crash_dump.c +++ b/src/report-python/crash_dump.c @@ -59,37 +59,21 @@ void add_to_crash_data_ext(crash_data_t *crash_data, const char *content, unsigned flags); */ -static PyObject *p_crash_data_add_ext(PyObject *pself, PyObject *args) +static PyObject *p_crash_data_add(PyObject *pself, PyObject *args) { p_crash_data *self = (p_crash_data*)pself; const char *name; const char *content; - int FLAGS; - if (!PyArg_ParseTuple(args, "ssi", &name, &content, &FLAGS)) + int flags = 0; + if (!PyArg_ParseTuple(args, "ss|i", &name, &content, &flags)) { /* PyArg_ParseTuple raises the exception saying why it fails * eg: TypeError: function takes exactly 2 arguments (1 given) */ return NULL; } - add_to_crash_data_ext(self->cd, name, content, FLAGS); - - /* every function returns PyObject, to return void we need to do this */ - Py_RETURN_NONE; -} - -static PyObject *p_crash_data_add(PyObject *pself, PyObject *args) -{ - p_crash_data *self = (p_crash_data*)pself; - - const char *name; - const char *content; - if (!PyArg_ParseTuple(args, "ss", &name, &content)) - { - return NULL; - } - add_to_crash_data(self->cd, name, content); + add_to_crash_data_ext(self->cd, name, content, flags); /* every function returns PyObject, to return void we need to do this */ Py_RETURN_NONE; @@ -108,14 +92,14 @@ static PyObject *p_get_crash_data_item(PyObject *pself, PyObject *args) return Py_BuildValue("sI", ci->content, ci->flags); } -/* struct dump_dir *create_crash_dump_dir(crash_data_t *crash_data); */ -static PyObject *p_create_crash_dump_dir(PyObject *pself, PyObject *args) +/* struct dump_dir *create_dump_dir(crash_data_t *crash_data); */ +static PyObject *p_create_dump_dir(PyObject *pself, PyObject *args) { p_crash_data *self = (p_crash_data*)pself; p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); if (!new_dd) return NULL; - struct dump_dir *dd = create_crash_dump_dir(self->cd); + struct dump_dir *dd = create_dump_dir(self->cd); if (!dd) { PyObject_Del((PyObject*)new_dd); @@ -131,10 +115,9 @@ static PyObject *p_create_crash_dump_dir(PyObject *pself, PyObject *args) //}; static PyMethodDef p_crash_data_methods[] = { - { "add" , p_crash_data_add, METH_VARARGS, "Adds item to the crash data using default flags" }, - { "add_ext" , p_crash_data_add_ext, METH_VARARGS, "Adds item to the crash data" }, - { "get" , p_get_crash_data_item, METH_VARARGS, "Gets the value of item indexed by the key" }, - { "create_crash_dump_dir", p_create_crash_dump_dir, METH_NOARGS, "Saves the crash_data to"LOCALSTATEDIR"/run/abrt/tmp-<pid>-<time>" }, + { "add" , p_crash_data_add, METH_VARARGS, "Adds item to the crash data" }, + { "get" , p_get_crash_data_item, METH_VARARGS, "Gets the value of item indexed by the key" }, + { "create_dump_dir", p_create_dump_dir, METH_NOARGS, "Saves the crash_data to"LOCALSTATEDIR"/run/abrt/tmp-<pid>-<time>" }, { NULL } }; diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index 8e1f17ef..df61ea74 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -199,5 +199,5 @@ PyObject *p_dd_create(PyObject *module, PyObject *args) return (PyObject*)new_dd; } -/* void delete_crash_dump_dir(const char *dd_dir); */ -//static PyObject *p_delete_crash_dump_dir(PyObject *pself, PyObject *args); +/* void delete_dump_dir(const char *dd_dir); */ +//static PyObject *p_delete_dump_dir(PyObject *pself, PyObject *args); diff --git a/src/report-python/reportmodule.c b/src/report-python/reportmodule.c index 5fa31ca2..4d38eeab 100644 --- a/src/report-python/reportmodule.c +++ b/src/report-python/reportmodule.c @@ -22,9 +22,9 @@ PyObject *ReportError; static PyMethodDef module_methods[] = { - { "dd_opendir" , p_dd_opendir, METH_VARARGS, NULL }, - { "dd_create" , p_dd_create, METH_VARARGS, NULL }, -// { "delete_crash_dump_dir", p_delete_crash_dump_dir, METH_VARARGS, NULL }, + { "dd_opendir" , p_dd_opendir, METH_VARARGS, NULL }, + { "dd_create" , p_dd_create, METH_VARARGS, NULL }, +// { "delete_dump_dir", p_delete_dump_dir, METH_VARARGS, NULL }, { NULL } }; diff --git a/src/report-python/test_crash_data b/src/report-python/test_crash_data index 50afc002..5f8f9a86 100755 --- a/src/report-python/test_crash_data +++ b/src/report-python/test_crash_data @@ -6,7 +6,7 @@ import report cd = crash_data() cd.add("foo", "bar") -dd = cd.create_crash_dump_dir() +dd = cd.create_dump_dir() if dd: print "dd is nonzero" |
