1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-23 05:26:16 +01:00

- use Request's __cmd__ method for sorting

This commit is contained in:
Marcus Huewe 2011-02-09 15:51:26 +01:00
parent 69458ca8c4
commit 7d5893992d
2 changed files with 2 additions and 5 deletions

View File

@ -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:

View File

@ -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