From: Alex Schroeder Date: Thu, 15 Aug 2019 09:52:39 +0000 (+0200) Subject: Sort posts before selecting one by number X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fac4e3ca5d526aa40ab4ce1cb26c474f77db4c98;p=jan-pona-mute.git Sort posts before selecting one by number --- diff --git a/jan-pona-mute.py b/jan-pona-mute.py index c24b126..7b7e115 100755 --- a/jan-pona-mute.py +++ b/jan-pona-mute.py @@ -318,7 +318,8 @@ post again.""" self.show(notification) self.load(notification.about()) elif self.numbers_refer_to == 'home': - self.post = self.home[n-1] + posts = sorted(self.home, key=lambda x: x.data()["created_at"]) + self.post = posts[n-1] else: print("Internal error: not sure what numbers '%s' refer to." % self.numbers_refer_to) return