summaryrefslogtreecommitdiff
path: root/python/acquire.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-01-13 17:22:27 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-01-13 17:22:27 +0100
commit38d602dc83006c51dfe4ed594d691ea9b0679498 (patch)
treeb7aedfba82c44cad6c3012f879b5d6d7e8ad1425 /python/acquire.cc
parent12cf58d12b969010f3d98b2974d72bbb950b775f (diff)
parent614897f798d9f16591fbd29ebe2a6c5674102d2d (diff)
downloadpython-apt-38d602dc83006c51dfe4ed594d691ea9b0679498.tar.gz
* apt/*.py:
- Almost complete cleanup of the code - Remove inconsistent use of tabs and spaces (Closes: #505443) - Improved documentation * apt/debfile.py: - Drop get*() methods, as they are deprecated and were never in a stable release - Make DscSrcPackage working * apt/gtk/widgets.py: - Fix the code and document the signals * Introduce new documentation build with Sphinx - Contains style Guide (Closes: #481562) - debian/rules: Build the documentation here - setup.py: Remove pydoc building and add new docs. - debian/examples: Include examples from documentation - debian/python-apt.docs: + Change html/ to build/doc/html. + Add build/doc/text for the text-only documentation * setup.py: - Only create build/data when building, not all the time - Remove build/mo and build/data on clean -a * debian/control: - Remove the Conflicts on python2.3-apt, python2.4-apt, as they are only needed for oldstable (sarge) - Build-Depend on python-sphinx (>= 0.5) * aptsources/distinfo.py: - Allow @ in mirror urls (Closes: #478171) (LP: #223097) * Merge Ben Finney's whitespace changes (Closes: #481563) * Merge Ben Finney's do not use has_key() (Closes: #481878) * Do not use deprecated form of raise statement (Closes: #494259) * Add support for PkgRecords.SHA256Hash (Closes: #456113)
Diffstat (limited to 'python/acquire.cc')
-rw-r--r--python/acquire.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/python/acquire.cc b/python/acquire.cc
index 9cf84928..1ecf55a5 100644
--- a/python/acquire.cc
+++ b/python/acquire.cc
@@ -16,7 +16,7 @@
static PyObject *AcquireItemAttr(PyObject *Self,char *Name)
{
pkgAcquire::ItemIterator &I = GetCpp<pkgAcquire::ItemIterator>(Self);
-
+
if (strcmp("ID",Name) == 0)
return Py_BuildValue("i",(*I)->ID);
else if (strcmp("Status",Name) == 0)
@@ -56,7 +56,7 @@ static PyObject *AcquireItemAttr(PyObject *Self,char *Name)
static PyObject *AcquireItemRepr(PyObject *Self)
{
pkgAcquire::ItemIterator &I = GetCpp<pkgAcquire::ItemIterator>(Self);
-
+
char S[300];
snprintf(S,sizeof(S),"<pkgAcquire::ItemIterator object: "
"Status: %i Complete: %i Local: %i IsTrusted: %i "
@@ -91,11 +91,11 @@ PyTypeObject AcquireItemType =
static PyObject *PkgAcquireRun(PyObject *Self,PyObject *Args)
-{
+{
pkgAcquire *fetcher = GetCpp<pkgAcquire*>(Self);
int pulseInterval = 500000;
- if (PyArg_ParseTuple(Args, "|i", &pulseInterval) == 0)
+ if (PyArg_ParseTuple(Args, "|i", &pulseInterval) == 0)
return 0;
pkgAcquire::RunResult run = fetcher->Run(pulseInterval);
@@ -104,19 +104,19 @@ static PyObject *PkgAcquireRun(PyObject *Self,PyObject *Args)
}
static PyObject *PkgAcquireShutdown(PyObject *Self,PyObject *Args)
-{
+{
pkgAcquire *fetcher = GetCpp<pkgAcquire*>(Self);
- if (PyArg_ParseTuple(Args, "") == 0)
+ if (PyArg_ParseTuple(Args, "") == 0)
return 0;
fetcher->Shutdown();
Py_INCREF(Py_None);
- return HandleErrors(Py_None);
+ return HandleErrors(Py_None);
}
-static PyMethodDef PkgAcquireMethods[] =
+static PyMethodDef PkgAcquireMethods[] =
{
{"Run",PkgAcquireRun,METH_VARARGS,"Run the fetcher"},
{"Shutdown",PkgAcquireShutdown, METH_VARARGS,"Shutdown the fetcher"},
@@ -128,16 +128,16 @@ static PyObject *AcquireAttr(PyObject *Self,char *Name)
{
pkgAcquire *fetcher = GetCpp<pkgAcquire*>(Self);
- if(strcmp("TotalNeeded",Name) == 0)
+ if(strcmp("TotalNeeded",Name) == 0)
return Py_BuildValue("d", fetcher->TotalNeeded());
- if(strcmp("FetchNeeded",Name) == 0)
+ if(strcmp("FetchNeeded",Name) == 0)
return Py_BuildValue("d", fetcher->FetchNeeded());
- if(strcmp("PartialPresent",Name) == 0)
+ if(strcmp("PartialPresent",Name) == 0)
return Py_BuildValue("d", fetcher->PartialPresent());
- if(strcmp("Items",Name) == 0)
+ if(strcmp("Items",Name) == 0)
{
PyObject *List = PyList_New(0);
- for (pkgAcquire::ItemIterator I = fetcher->ItemsBegin();
+ for (pkgAcquire::ItemIterator I = fetcher->ItemsBegin();
I != fetcher->ItemsEnd(); I++)
{
PyObject *Obj;
@@ -149,11 +149,11 @@ static PyObject *AcquireAttr(PyObject *Self,char *Name)
return List;
}
// some constants
- if(strcmp("ResultContinue",Name) == 0)
+ if(strcmp("ResultContinue",Name) == 0)
return Py_BuildValue("i", pkgAcquire::Continue);
- if(strcmp("ResultFailed",Name) == 0)
+ if(strcmp("ResultFailed",Name) == 0)
return Py_BuildValue("i", pkgAcquire::Failed);
- if(strcmp("ResultCancelled",Name) == 0)
+ if(strcmp("ResultCancelled",Name) == 0)
return Py_BuildValue("i", pkgAcquire::Cancelled);
return Py_FindMethod(PkgAcquireMethods,Self,Name);
@@ -201,7 +201,7 @@ PyObject *GetAcquire(PyObject *Self,PyObject *Args)
CppPyObject<pkgAcquire*> *FetcherObj =
CppPyObject_NEW<pkgAcquire*>(&PkgAcquireType, fetcher);
-
+
return FetcherObj;
}
@@ -255,8 +255,8 @@ PyObject *GetPkgAcqFile(PyObject *Self, PyObject *Args, PyObject * kwds)
"destDir", "destFile", NULL};
if (PyArg_ParseTupleAndKeywords(Args, kwds, "O!s|sissss", kwlist,
- &PkgAcquireType, &pyfetcher, &uri, &md5,
- &size, &descr, &shortDescr, &destDir, &destFile) == 0)
+ &PkgAcquireType, &pyfetcher, &uri, &md5,
+ &size, &descr, &shortDescr, &destDir, &destFile) == 0)
return 0;
pkgAcquire *fetcher = GetCpp<pkgAcquire*>(pyfetcher);