From cbeed2d5cc5898ebbd73e116148c2173851feb59 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 3 Sep 2013 18:28:02 +0200 Subject: Sort issues by 'most recently updated' --- issues.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/issues.py b/issues.py index 373b9a5..372e5af 100755 --- a/issues.py +++ b/issues.py @@ -278,7 +278,21 @@ for tracker in trackers: issue_title_prefix = getIssueTitlePrefix(trackername) items.append((tracker, issue_title_prefix)) +def item_sorting_key(itemtuple): + latest = int(itemtuple[0].find('field',attrs={'name':'open_date'}).string) + + messages = itemtuple[0].findAll('message',recursive=True) + for followup in messages: + commentdate = int(followup.find('field',attrs={'name':'adddate'}).string) + if commentdate > latest: + latest = commentdate + + return latest + + print "Found", len(items), "items (" + str(skipped_count) + " skipped) in", len(trackers), "trackers." +print "Sorting items..." +items.sort(key=item_sorting_key) userVerify("Everything ok, should I really start?") github_password = getpass('%s\'s GitHub password: ' % github_user) -- cgit v1.2.3