summaryrefslogtreecommitdiff
path: root/python/acquire-item.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-04-01 19:55:13 +0200
committerJulian Andres Klode <jak@debian.org>2010-04-01 19:55:13 +0200
commit17b0dc6856855f2cd46d234357f0de584db2019e (patch)
treeb17863d7e0c27290c98dc3f19846d44aab27666b /python/acquire-item.cc
parentc3d6edddcdcd40ff7477430a20a3e3be7e188963 (diff)
downloadpython-apt-17b0dc6856855f2cd46d234357f0de584db2019e.tar.gz
python: Document every class, function, property.
Finally, a complete reference to apt_pkg available via pydoc and __doc__ attributes.
Diffstat (limited to 'python/acquire-item.cc')
-rw-r--r--python/acquire-item.cc60
1 files changed, 45 insertions, 15 deletions
diff --git a/python/acquire-item.cc b/python/acquire-item.cc
index cdb4a4bc..d8185ff1 100644
--- a/python/acquire-item.cc
+++ b/python/acquire-item.cc
@@ -124,17 +124,30 @@ static int acquireitem_set_id(PyObject *self, PyObject *value, void *closure)
static PyGetSetDef acquireitem_getset[] = {
- {"complete",acquireitem_get_complete},
- {"desc_uri",acquireitem_get_desc_uri},
- {"destfile",acquireitem_get_destfile},
- {"error_text",acquireitem_get_error_text},
- {"filesize",acquireitem_get_filesize},
- {"id",acquireitem_get_id,acquireitem_set_id},
- {"mode",acquireitem_get_mode},
- {"is_trusted",acquireitem_get_is_trusted},
- {"local",acquireitem_get_local},
- {"partialsize",acquireitem_get_partialsize},
- {"status",acquireitem_get_status},
+ {"complete",acquireitem_get_complete,0,
+ "A boolean value determining whether the item has been fetched\n"
+ "completely"},
+ {"desc_uri",acquireitem_get_desc_uri,NULL,
+ "A string describing the URI from which the item is acquired."},
+ {"destfile",acquireitem_get_destfile,NULL,
+ "The path to the file where the item will be stored"},
+ {"error_text",acquireitem_get_error_text,NULL,
+ "If an error occured, a string describing the error; empty string\n"
+ "otherwise"},
+ {"filesize",acquireitem_get_filesize,NULL,
+ "The size of the file. If unknown, it is set to 0."},
+ {"id",acquireitem_get_id,acquireitem_set_id,
+ "The ID of the item. An integer which can be set by progress classes."},
+ {"mode",acquireitem_get_mode,NULL,
+ "A string indicating the current mode e.g. 'Fetching'."},
+ {"is_trusted",acquireitem_get_is_trusted,NULL,
+ "Whether the item is trusted or not."},
+ {"local",acquireitem_get_local,NULL,
+ "Whether we are fetching a local item (copy:/) or not."},
+ {"partialsize",acquireitem_get_partialsize,NULL,
+ "The amount of data which has already been fetched."},
+ {"status",acquireitem_get_status,NULL,
+ "The status of the item."},
{}
};
@@ -158,6 +171,10 @@ static void acquireitem_dealloc(PyObject *self)
CppDeallocPtr<pkgAcquire::Item*>(self);
}
+static const char *acquireitem_doc =
+ "Representation of an Acquire item. It is not possible to create\n"
+ "instances of this class, but it is possible to create instances\n"
+ "of the AcquireFile subclass.";
PyTypeObject PyAcquireItem_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"apt_pkg.AcquireItem", // tp_name
@@ -181,7 +198,7 @@ PyTypeObject PyAcquireItem_Type = {
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_HAVE_GC, // tp_flags
- "AcquireItem Object", // tp_doc
+ acquireitem_doc, // tp_doc
CppTraverse<pkgAcquire::Item*>, // tp_traverse
CppClear<pkgAcquire::Item*>, // tp_clear
0, // tp_richcompare
@@ -226,9 +243,22 @@ static PyObject *acquirefile_new(PyTypeObject *type, PyObject *Args, PyObject *
static char *acquirefile_doc =
"AcquireFile(owner, uri[, md5, size, descr, short_descr, destdir,"
- "destfile]) -> New AcquireFile() object\n\n"
- "The parameter *owner* refers to an apt_pkg.Acquire() object. You can use\n"
- "*destdir* OR *destfile* to specify the destination directory/file.";
+ "destfile])\n\n"
+ "Represent a file to be fetched. The parameter 'owner' points to\n"
+ "an apt_pkg.Acquire object and the parameter 'uri' to the source\n"
+ "location. The destination can be specified by either 'destdir'\n"
+ "for specifying the destination directory or 'destfile' for\n"
+ "specifying the path to the destination file.\n"
+ "\n"
+ "The parameters 'short_descr' and 'descr' can be used to specify\n"
+ "a short description and a longer description for the item. This\n"
+ "information is used by progress classes to refer to the item.\n"
+ "\n"
+ "The parameters 'md5' and 'size' are used to verify the resulting\n"
+ "file. The parameter 'size' is also to calculate the total amount\n"
+ "of data to be fetched and is useful for resuming a interrupted\n"
+ "download.\n\n"
+ "All parameters can be given by name (i.e. as keyword arguments).";
PyTypeObject PyAcquireFile_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)