From dabc8c6796afdaf0e2918db77117a07eae8b1fd4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 13 Jul 2009 14:25:06 +0200 Subject: python: Rename all PyTypeObject's to conform to PEP 7. This is the first step towards implementing coding guidelines for the C++ code and providing an usable C++ API. --- python/policy.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'python/policy.cc') diff --git a/python/policy.cc b/python/policy.cc index d086c4fc..faf53b38 100644 --- a/python/policy.cc +++ b/python/policy.cc @@ -29,7 +29,7 @@ static PyObject *Policy_NEW(PyTypeObject *type,PyObject *Args, char *kwlist[] = {"cache", NULL}; if (PyArg_ParseTupleAndKeywords(Args, kwds, "O", kwlist, &cache) == 0) return 0; - if (!PyObject_TypeCheck(cache, &PkgCacheType)) { + if (!PyObject_TypeCheck(cache, &PyCache_Type)) { PyErr_SetString(PyExc_TypeError,"`cache` must be a apt_pkg.Cache()."); return 0; } @@ -43,7 +43,7 @@ static char *Policy_GetPriority_doc = "get_priority(package: apt_pkg.Package)" PyObject *Policy_GetPriority(PyObject *self, PyObject *arg) { pkgPolicy *policy = GetCpp(self); - if (PyObject_TypeCheck(arg, &PackageType)) { + if (PyObject_TypeCheck(arg, &PyPackage_Type)) { pkgCache::PkgIterator pkg = GetCpp(arg); return Py_BuildValue("i", policy->GetPriority(pkg)); } else { @@ -57,11 +57,11 @@ static char *Policy_GetCandidateVer_doc = "get_match(package: apt_pkg.Package)" "Get the best package for the job."; PyObject *Policy_GetCandidateVer(PyObject *self, PyObject *arg) { - if (PyObject_TypeCheck(arg, &PackageType)) { + if (PyObject_TypeCheck(arg, &PyPackage_Type)) { pkgPolicy *policy = GetCpp(self); pkgCache::PkgIterator pkg = GetCpp(arg); pkgCache::VerIterator ver = policy->GetCandidateVer(pkg); - return CppOwnedPyObject_NEW(arg,&VersionType, + return CppOwnedPyObject_NEW(arg,&PyVersion_Type, ver); } else { PyErr_SetString(PyExc_TypeError,"Argument must be of Package()."); @@ -74,14 +74,14 @@ static char *Policy_GetMatch_doc = "get_match(package: apt_pkg.Package) -> " "Return a matching version for the given package."; static PyObject *Policy_GetMatch(PyObject *self, PyObject *arg) { - if (PyObject_TypeCheck(arg, &PackageType) == 0) { + if (PyObject_TypeCheck(arg, &PyPackage_Type) == 0) { PyErr_SetString(PyExc_TypeError,"Argument must be of Package()."); return 0; } pkgPolicy *policy = GetCpp(self); pkgCache::PkgIterator pkg = GetCpp(arg); pkgCache::VerIterator ver = policy->GetMatch(pkg); - return CppOwnedPyObject_NEW(arg,&VersionType,ver); + return CppOwnedPyObject_NEW(arg,&PyVersion_Type,ver); } static char *Policy_ReadPinFile_doc = "read_pinfile(filename: str) -> bool\n\n" -- cgit v1.2.3