diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-06-29 11:02:42 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-06-29 11:02:42 +0200 |
| commit | cdaebccd5f7a5a0e23a9be7989b64850fabafed1 (patch) | |
| tree | 52d3bd94c02ae9be75fb11bfd423043ef10838cc /python/indexfile.cc | |
| parent | 57624b5df523c0b3a3ebc1741680f283ee1fbbcd (diff) | |
| parent | 340f6a3d54f5705801267f365fb08b5d20228fe6 (diff) | |
| download | python-apt-cdaebccd5f7a5a0e23a9be7989b64850fabafed1.tar.gz | |
merged from debian-sid
Diffstat (limited to 'python/indexfile.cc')
| -rw-r--r-- | python/indexfile.cc | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/python/indexfile.cc b/python/indexfile.cc index 5e66b06a..037be210 100644 --- a/python/indexfile.cc +++ b/python/indexfile.cc @@ -27,10 +27,9 @@ static PyObject *IndexFileArchiveURI(PyObject *Self,PyObject *Args) static PyMethodDef IndexFileMethods[] = { - {"archive_uri",IndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, -#ifdef COMPAT_0_7 - {"ArchiveURI",IndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, -#endif + {"archive_uri",IndexFileArchiveURI,METH_VARARGS, + "archive_uri(path: str) -> str\n\n" + "Return the URI to the given path in the archive."}, {} }; @@ -42,16 +41,16 @@ static PyObject *IndexFileGetDescribe(PyObject *Self,void*) { return Safe_FromString(File->Describe().c_str()); } static PyObject *IndexFileGetExists(PyObject *Self,void*) { - return Py_BuildValue("i",(File->Exists())); + return PyBool_FromLong((File->Exists())); } static PyObject *IndexFileGetHasPackages(PyObject *Self,void*) { - return Py_BuildValue("i",(File->HasPackages())); + return PyBool_FromLong((File->HasPackages())); } static PyObject *IndexFileGetSize(PyObject *Self,void*) { return Py_BuildValue("i",(File->Size())); } static PyObject *IndexFileGetIsTrusted(PyObject *Self,void*) { - return Py_BuildValue("i",(File->IsTrusted())); + return PyBool_FromLong((File->IsTrusted())); } #undef File @@ -70,15 +69,26 @@ static PyObject *IndexFileRepr(PyObject *Self) #undef S static PyGetSetDef IndexFileGetSet[] = { - {"describe",IndexFileGetDescribe}, - {"exists",IndexFileGetExists}, - {"has_packages",IndexFileGetHasPackages}, - {"is_trusted",IndexFileGetIsTrusted}, - {"label",IndexFileGetLabel}, - {"size",IndexFileGetSize}, + {"describe",IndexFileGetDescribe,0, + "A string describing the index file."}, + {"exists",IndexFileGetExists,0, + "A boolean value determining whether the index file exists."}, + {"has_packages",IndexFileGetHasPackages,0, + "A boolean value determining whether the index file has packages."}, + {"is_trusted",IndexFileGetIsTrusted,0, + "A boolean value determining whether the file can be trusted; e.g.\n" + "because it is from a source with a GPG signed Release file."}, + {"label",IndexFileGetLabel,0, + "The label of the index file."}, + {"size",IndexFileGetSize,0, + "The size of the files, measured in bytes."}, {} }; +static const char *indexfile_doc = + "Represent an index file, i.e. package indexes, translation indexes,\n" + "and source indexes."; + PyTypeObject PyIndexFile_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) @@ -103,7 +113,7 @@ PyTypeObject PyIndexFile_Type = 0, // tp_setattro 0, // tp_as_buffer Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags - "IndexFile Object", // tp_doc + indexfile_doc, // tp_doc CppTraverse<pkgIndexFile*>, // tp_traverse CppClear<pkgIndexFile*>, // tp_clear 0, // tp_richcompare |
