From 88c1a8281037c10c280a7995872aa0b753851b72 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Tue, 13 Aug 2019 23:26:27 +0200 Subject: [PATCH] fix comment counting --- jan-pona-mute.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jan-pona-mute.py b/jan-pona-mute.py index 1bb3b70..63deec7 100755 --- a/jan-pona-mute.py +++ b/jan-pona-mute.py @@ -274,7 +274,10 @@ The index number must refer to the current list of notifications.""" if(self.post.comments): print() - print("There are %d comments." % self.post.comments.length()) + if len(self.post.comments) == 1: + print("There is 1 comment.") + else: + print("There are %d comments." % len(self.post.comments)) print("Use the 'comments' command to list the latest comments.") def load(self, id): @@ -301,9 +304,9 @@ or get it from the cache.""" def show(self, item): """Show the current item.""" if self.pager: - subprocess.run(self.pager, input = repr(item), text = True) + subprocess.run(self.pager, input = str(item), text = True) else: - print(repr(item)) + print(str(item)) def do_comments(self, line): """Show the comments for the current post. -- 2.25.1