diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-05 10:32:04 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-05 10:32:04 +0200 |
| commit | f17fc818cca41668bb6358e490ff3278e64fa493 (patch) | |
| tree | 0ee5c2b599b22a82e7247df291f8f7c95eb03dca /apt | |
| parent | a2363f7e30c93599af6366413bad965846a12d83 (diff) | |
| download | python-apt-f17fc818cca41668bb6358e490ff3278e64fa493.tar.gz | |
* tests/test_apt_cache.py:
- add __cmp__ to apt.Package so that sort() sorts by name
on list of package objects
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/package.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apt/package.py b/apt/package.py index 4104f93e..cb373c2e 100644 --- a/apt/package.py +++ b/apt/package.py @@ -707,6 +707,9 @@ class Package(object): return '<Package: name:%r architecture=%r id:%r>' % (self._pkg.name, self._pkg.architecture, self._pkg.id) + def __cmp__(self, other): + return cmp(self.name, other.name) + def candidate(self): """Return the candidate version of the package. |
