From 7d5893992d356a02e0cba0677a81d0d46bfc265f Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Wed, 9 Feb 2011 15:51:26 +0100 Subject: [PATCH] - use Request's __cmd__ method for sorting --- osc/commandline.py | 2 +- osc/core.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 1e7ba524..3f76f4fc 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5044,7 +5044,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. what = {'project': ''} elif type in args_sr: requests = get_request_list(apiurl, req_who=user, exclude_target_projects=exclude_projects) - for r in requests_sort(requests): + for r in sorted(requests): print r.list_view(), '\n' return elif not type in args_pkg: diff --git a/osc/core.py b/osc/core.py index 988edcc3..32deb7cb 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2568,7 +2568,7 @@ class Request: return '\n'.join(lines) def __cmp__(self, other): - return cmp(self.reqid, other.reqid) + return cmp(int(self.reqid), int(other.reqid)) def create(self, apiurl): """create a new request""" @@ -6122,7 +6122,4 @@ def filter_role(meta, user, role): for node in delete: root.remove(node) -def requests_sort(requests): - return sorted(requests, cmp=lambda a,b: cmp(int(a.reqid), int(b.reqid))) - # vim: sw=4 et