diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-08-08 19:36:30 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-08-08 19:36:30 +0200 |
| commit | 931107a69fc1b628f09dd0a04ae0e57f822d1ead (patch) | |
| tree | a09033cedb2deffe157cb5a2764b3565885ca9a9 /python | |
| parent | 58c1b550e9a96dbd1efcf42a8389b6819249aee5 (diff) | |
| download | python-apt-931107a69fc1b628f09dd0a04ae0e57f822d1ead.tar.gz | |
python/arfile.cc: Rename getdata() to extractdata().
This makes it more consistent with the interface of tarfile.TarFile, which
provides a extractfile() function. Since producing a file-like object is a
bit to complicated here, we simply return the string and thus name the
method extractdata().
Diffstat (limited to 'python')
| -rw-r--r-- | python/arfile.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/arfile.cc b/python/arfile.cc index 2eb6f1cd..4eb651dd 100644 --- a/python/arfile.cc +++ b/python/arfile.cc @@ -156,14 +156,14 @@ PyObject *ararchive_getmember(PyArArchiveObject *self, PyObject *arg) return ret; } -static const char *ararchive_getdata_doc = - "getdata(name: str) -> bytes\n\n" +static const char *ararchive_extractdata_doc = + "extractdata(name: str) -> bytes\n\n" "Return the contents of the member, as a bytes object. Raise\n" "LookupError if there is no ArMember with the given name."; -PyObject *ararchive_getdata(PyArArchiveObject *self, PyObject *args) +PyObject *ararchive_extractdata(PyArArchiveObject *self, PyObject *args) { char *name = 0; - if (PyArg_ParseTuple(args, "s:getdata", &name) == 0) + if (PyArg_ParseTuple(args, "s:extractdata", &name) == 0) return 0; const ARArchive::Member *member = self->Object->FindMember(name); if (!member) { @@ -302,8 +302,8 @@ PyMethodDef ararchive_methods[] = { ararchive_getmember_doc}, {"gettar",(PyCFunction)ararchive_gettar,METH_VARARGS, ararchive_gettar_doc}, - {"getdata",(PyCFunction)ararchive_getdata,METH_VARARGS, - ararchive_getdata_doc}, + {"extractdata",(PyCFunction)ararchive_extractdata,METH_VARARGS, + ararchive_extractdata_doc}, {"extract",(PyCFunction)ararchive_extract,METH_VARARGS, ararchive_extract_doc}, {"getmembers",(PyCFunction)ararchive_getmembers,METH_NOARGS, |
