summaryrefslogtreecommitdiff
path: root/python/policy.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-06-01 17:08:24 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-06-01 17:08:24 +0200
commite74ead9f918b38bfe8ae5cfe941df4057dcc509e (patch)
tree9f678aa2510cb1df272cd5beca5cf551794e6307 /python/policy.cc
parent5a062bb328348cd3a2ac693b579d35d0ce8e11f0 (diff)
parent50f9df7e415deb9bb6156ef8f596b6d4d49b23a4 (diff)
downloadpython-apt-e74ead9f918b38bfe8ae5cfe941df4057dcc509e.tar.gz
* merge from debian bzr, remaining changes:
- different mirror list * data/templates/gNewSense.info.in, data/templates/gNewSense.mirrors: - add gNewSense template and mirrors, thanks to Karl Goetz * apt/cache.py: - Make Cache.get_changes() much (~35x) faster (Closes: #578074). - Make Cache.req_reinstall_pkgs much faster as well. - Make Cache.get_providing_packages() about 1000 times faster. - Use has_versions and has_provides from apt_pkg.Package where possible. * apt/package.py: - Decode using utf-8 in installed_files (LP: #407953). - Fix fetch_source() to work when source name = binary name (LP: #552400). - Merge a patch from Sebastian Heinlein to make get_changelog() only check sources where source version >= binary version (Closes: #581831). - Add Version.source_version and enhance Sebastian's patch to make use of it, in order to find the best changelog for the package. * python: - Return bool instead of int to Python where possible, looks better. - Document every class, function, property. * python/cache.cc: - Check that 2nd argument to Cache.update() really is a SourceList object. - Fix PackageFile.not_automatic to use NotAutomatic instead of NotSource. - Add Package.has_versions to see which packages have at least one version, and Package.has_provides for provides. - Add rich compare methods to the Version object. * python/generic.cc: - Fix a memory leak when using old attribute names. - Map ArchiveURI property to archive_uri * python/progress.cc: - Do not pass arguments to InstallProgress.wait_child(). * doc: - Update the long documentation. * debian/control: - Change priority to standard, keep -doc and -dev on optional. * utils/migrate-0.8.py: - Open files in universal newline support and pass filename to ast.parse. - Add has_key to the list of deprecated functions. - Don't abort if parsing failed. - do not require files to end in .py if they are passed on the command line or if they contain python somewhere in the shebang line. * apt/cache.py: - make cache open silent by default (use apt.progress.base.OpProgress) * tests/data/aptsources_ports/sources.list: - fix ports test-data * tests/test_apt_cache.py: - add simple test for basic cache/dependency iteration
Diffstat (limited to 'python/policy.cc')
-rw-r--r--python/policy.cc39
1 files changed, 21 insertions, 18 deletions
diff --git a/python/policy.cc b/python/policy.cc
index 3e1ec589..7eccb30c 100644
--- a/python/policy.cc
+++ b/python/policy.cc
@@ -37,8 +37,8 @@ static PyObject *policy_new(PyTypeObject *type,PyObject *Args,
return CppPyObject_NEW<pkgPolicy*>(cache,&PyPolicy_Type,policy);
}
-static char *policy_get_priority_doc = "get_priority(package: apt_pkg.Package)"
- " -> int\n\n"
+static char *policy_get_priority_doc =
+ "get_priority(package: apt_pkg.Package) -> int\n\n"
"Return the priority of the package.";
PyObject *policy_get_priority(PyObject *self, PyObject *arg) {
@@ -52,8 +52,8 @@ PyObject *policy_get_priority(PyObject *self, PyObject *arg) {
}
}
-static char *policy_get_candidate_ver_doc = "get_match(package: apt_pkg.Package)"
- " -> apt_pkg.Version\n\n"
+static char *policy_get_candidate_ver_doc =
+ "get_match(package: apt_pkg.Package) -> apt_pkg.Version\n\n"
"Get the best package for the job.";
PyObject *policy_get_candidate_ver(PyObject *self, PyObject *arg) {
@@ -69,8 +69,8 @@ PyObject *policy_get_candidate_ver(PyObject *self, PyObject *arg) {
}
}
-static char *policy_get_match_doc = "get_match(package: apt_pkg.Package) -> "
- "apt_pkg.Version\n\n"
+static char *policy_get_match_doc =
+ "get_match(package: apt_pkg.Package) -> apt_pkg.Version\n\n"
"Return a matching version for the given package.";
static PyObject *policy_get_match(PyObject *self, PyObject *arg) {
@@ -84,9 +84,10 @@ static PyObject *policy_get_match(PyObject *self, PyObject *arg) {
return CppPyObject_NEW<pkgCache::VerIterator>(arg,&PyVersion_Type,ver);
}
-static char *policy_read_pinfile_doc = "read_pinfile(filename: str) -> bool\n\n"
- "Read the pin file given by filename (e.g. '/etc/apt/preferences') and\n"
- "add it to the policy.";
+static char *policy_read_pinfile_doc =
+ "read_pinfile(filename: str) -> bool\n\n"
+ "Read the pin file given by filename (e.g. '/etc/apt/preferences')\n"
+ "and add it to the policy.";
static PyObject *policy_read_pinfile(PyObject *self, PyObject *arg) {
if (!PyString_Check(arg))
@@ -97,9 +98,10 @@ static PyObject *policy_read_pinfile(PyObject *self, PyObject *arg) {
}
#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 8)
-static char *policy_read_pindir_doc = "read_pindir(dirname: str) -> bool\n\n"
- "Read the pin files in the given dir (e.g. '/etc/apt/preferences.d') and\n"
- "add them to the policy.";
+static char *policy_read_pindir_doc =
+ "read_pindir(dirname: str) -> bool\n\n"
+ "Read the pin files in the given dir (e.g. '/etc/apt/preferences.d')\n"
+ "and add them to the policy.";
static PyObject *policy_read_pindir(PyObject *self, PyObject *arg) {
if (!PyString_Check(arg))
@@ -110,12 +112,12 @@ static PyObject *policy_read_pindir(PyObject *self, PyObject *arg) {
}
#endif
-static char *policy_create_pin_doc = "create_pin(type: str, pkg: str, "
- "data: str, priority: int)\n\n"
+static char *policy_create_pin_doc =
+ "create_pin(type: str, pkg: str, data: str, priority: int)\n\n"
"Create a pin for the policy. The parameter 'type' refers to one of the\n"
- "following strings: 'Version', 'Release', 'Origin'. The argument 'pkg'\n"
- "is the name of the package, the parameter 'data' refers to the value\n"
- "e.g. unstable for type='Release' and the other possible options. \n"
+ "strings 'Version', 'Release', or 'Origin'. The argument 'pkg' is the\n"
+ "name of the package. The parameter 'data' refers to the value\n"
+ "(e.g. 'unstable' for type='Release') and the other possible options.\n"
"The parameter 'priority' gives the priority of the pin.";
static PyObject *policy_create_pin(PyObject *self, PyObject *args) {
@@ -154,7 +156,8 @@ static PyMethodDef policy_methods[] = {
{}
};
-static char *policy_doc = "Policy(cache)\n\n"
+static char *policy_doc =
+ "Policy(cache)\n\n"
"Representation of the policy of the Cache object given by cache. This\n"
"provides a superset of policy-related functionality compared to the\n"
"DepCache class. The DepCache can be used for most purposes, but there\n"