summaryrefslogtreecommitdiff
path: root/python/pkgsrcrecords.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/pkgsrcrecords.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/pkgsrcrecords.cc')
-rw-r--r--python/pkgsrcrecords.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc
index c698a925..f7f5d7a2 100644
--- a/python/pkgsrcrecords.cc
+++ b/python/pkgsrcrecords.cc
@@ -21,7 +21,7 @@ struct PkgSrcRecordsStruct
pkgSourceList List;
pkgSrcRecords *Records;
pkgSrcRecords::Parser *Last;
-
+
PkgSrcRecordsStruct() : Last(0) {
List.ReadMainList();
Records = new pkgSrcRecords(List);
@@ -30,24 +30,24 @@ struct PkgSrcRecordsStruct
delete Records;
};
};
-
+
// PkgSrcRecords Class /*{{{*/
// ---------------------------------------------------------------------
static char *doc_PkgSrcRecordsLookup = "xxx";
static PyObject *PkgSrcRecordsLookup(PyObject *Self,PyObject *Args)
-{
+{
PkgSrcRecordsStruct &Struct = GetCpp<PkgSrcRecordsStruct>(Self);
-
+
char *Name = 0;
if (PyArg_ParseTuple(Args,"s",&Name) == 0)
return 0;
-
+
Struct.Last = Struct.Records->Find(Name, false);
if (Struct.Last == 0) {
Struct.Records->Restart();
Py_INCREF(Py_None);
- return HandleErrors(Py_None);
+ return HandleErrors(Py_None);
}
return Py_BuildValue("i", 1);
@@ -55,20 +55,20 @@ static PyObject *PkgSrcRecordsLookup(PyObject *Self,PyObject *Args)
static char *doc_PkgSrcRecordsRestart = "Start Lookup from the begining";
static PyObject *PkgSrcRecordsRestart(PyObject *Self,PyObject *Args)
-{
+{
PkgSrcRecordsStruct &Struct = GetCpp<PkgSrcRecordsStruct>(Self);
-
+
char *Name = 0;
if (PyArg_ParseTuple(Args,"") == 0)
return 0;
-
+
Struct.Records->Restart();
Py_INCREF(Py_None);
- return HandleErrors(Py_None);
+ return HandleErrors(Py_None);
}
-static PyMethodDef PkgSrcRecordsMethods[] =
+static PyMethodDef PkgSrcRecordsMethods[] =
{
{"Lookup",PkgSrcRecordsLookup,METH_VARARGS,doc_PkgSrcRecordsLookup},
{"Restart",PkgSrcRecordsRestart,METH_VARARGS,doc_PkgSrcRecordsRestart},
@@ -111,10 +111,10 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name)
PyObject *v;
for(unsigned int i=0;i<f.size();i++) {
- v = Py_BuildValue("(siss)",
- f[i].MD5Hash.c_str(),
- f[i].Size,
- f[i].Path.c_str(),
+ v = Py_BuildValue("(siss)",
+ f[i].MD5Hash.c_str(),
+ f[i].Size,
+ f[i].Path.c_str(),
f[i].Type.c_str());
PyList_Append(List, v);
Py_DECREF(v);
@@ -129,7 +129,7 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name)
PyObject *v;
for(unsigned int i=0;i<bd.size();i++) {
- v = Py_BuildValue("(ssii)", bd[i].Package.c_str(),
+ v = Py_BuildValue("(ssii)", bd[i].Package.c_str(),
bd[i].Version.c_str(), bd[i].Op, bd[i].Type);
PyList_Append(List, v);
Py_DECREF(v);
@@ -137,7 +137,7 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name)
return List;
}
}
-
+
return Py_FindMethod(PkgSrcRecordsMethods,Self,Name);
}
PyTypeObject PkgSrcRecordsType =
@@ -174,7 +174,7 @@ PyObject *GetPkgSrcRecords(PyObject *Self,PyObject *Args)
#endif
if (PyArg_ParseTuple(Args,"") == 0)
return 0;
-
+
return HandleErrors(CppPyObject_NEW<PkgSrcRecordsStruct>(&PkgSrcRecordsType));
}