From b147f1846cd26ab25ad925105f52421992395918 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Fri, 16 May 2008 14:58:00 +1000 Subject: Remove trailing whitespace. --- python/pkgrecords.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'python/pkgrecords.cc') diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc index 93bc54d9..18240ce0 100644 --- a/python/pkgrecords.cc +++ b/python/pkgrecords.cc @@ -16,20 +16,20 @@ #include /*}}}*/ - + // PkgRecords Class /*{{{*/ // --------------------------------------------------------------------- static PyObject *PkgRecordsLookup(PyObject *Self,PyObject *Args) -{ +{ PkgRecordsStruct &Struct = GetCpp(Self); - + PyObject *PkgFObj; long int Index; if (PyArg_ParseTuple(Args,"(O!l)",&PackageFileType,&PkgFObj,&Index) == 0) return 0; - + // Get the index and check to make sure it is reasonable pkgCache::PkgFileIterator &PkgF = GetCpp(PkgFObj); pkgCache *Cache = PkgF.Cache(); @@ -39,15 +39,15 @@ static PyObject *PkgRecordsLookup(PyObject *Self,PyObject *Args) PyErr_SetNone(PyExc_IndexError); return 0; } - + // Do the lookup Struct.Last = &Struct.Records.Lookup(pkgCache::VerFileIterator(*Cache,Cache->VerFileP+Index)); // always return true (to make it consistent with the pkgsrcrecords object return Py_BuildValue("i", 1); } - -static PyMethodDef PkgRecordsMethods[] = + +static PyMethodDef PkgRecordsMethods[] = { {"Lookup",PkgRecordsLookup,METH_VARARGS,"Changes to a new package"}, {} @@ -79,14 +79,14 @@ static PyObject *PkgRecordsAttr(PyObject *Self,char *Name) return CppPyString(Struct.Last->Name()); else if (strcmp("Homepage",Name) == 0) return CppPyString(Struct.Last->Homepage()); - else if (strcmp("Record", Name) == 0) + else if (strcmp("Record", Name) == 0) { const char *start, *stop; Struct.Last->GetRec(start, stop); return PyString_FromStringAndSize(start,stop-start); } } - + return Py_FindMethod(PkgRecordsMethods,Self,Name); } PyTypeObject PkgRecordsType = -- cgit v1.2.3 From 2e980f4f190abb787f9aa9939a404875905d651c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 11 Jan 2009 20:02:29 +0100 Subject: * Add support for PkgRecords.SHA256Hash (Closes: #456113) --- debian/changelog | 3 ++- doc/source/apt_pkg/cache.rst | 5 +++++ python/pkgrecords.cc | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'python/pkgrecords.cc') diff --git a/debian/changelog b/debian/changelog index fbf665cd..49236999 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,8 +30,9 @@ python-apt (0.7.9~exp2) experimental; urgency=low * 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) - -- Julian Andres Klode Sun, 11 Jan 2009 19:55:11 +0100 + -- Julian Andres Klode Sun, 11 Jan 2009 20:01:59 +0100 python-apt (0.7.9~exp1) experimental; urgency=low diff --git a/doc/source/apt_pkg/cache.rst b/doc/source/apt_pkg/cache.rst index 0a02c47c..6e924aeb 100644 --- a/doc/source/apt_pkg/cache.rst +++ b/doc/source/apt_pkg/cache.rst @@ -923,6 +923,11 @@ broken dependencies: Return the SHA1 hashsum of the package. This refers to the field 'SHA1' in the raw record. + .. attribute:: SHA256Hash + + Return the SHA256 hashsum of the package. This refers to the field + 'SHA256' in the raw record. + .. attribute:: SourcePkg Return the source package. diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc index 18240ce0..5359ee6f 100644 --- a/python/pkgrecords.cc +++ b/python/pkgrecords.cc @@ -65,6 +65,8 @@ static PyObject *PkgRecordsAttr(PyObject *Self,char *Name) return CppPyString(Struct.Last->MD5Hash()); else if (strcmp("SHA1Hash",Name) == 0) return CppPyString(Struct.Last->SHA1Hash()); + else if (strcmp("SHA256Hash",Name) == 0) + return CppPyString(Struct.Last->SHA256Hash()); else if (strcmp("SourcePkg",Name) == 0) return CppPyString(Struct.Last->SourcePkg()); else if (strcmp("SourceVer",Name) == 0) -- cgit v1.2.3