From 14a0258632f962d2b9d1fa501815fb0792017c3e Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Fri, 27 Mar 2015 23:42:51 -0700 Subject: [PATCH] Removed trailing empty lines from comment message. --- rtv/submission.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rtv/submission.py b/rtv/submission.py index 0a9c4ec..a6cf600 100644 --- a/rtv/submission.py +++ b/rtv/submission.py @@ -125,7 +125,7 @@ class SubmissionPage(BasePage): return # Comment out every line of the content - content = '\n'.join(['#|' + line for line in content.split('\n')]) + content = '\n'.join(['# |' + line for line in content.split('\n')]) info = {'author': data['author'], 'type': data['type'], 'content': content} @@ -139,9 +139,10 @@ class SubmissionPage(BasePage): fp.seek(0) comment_text = '\n'.join(line for line in fp.read().split('\n') if not line.startswith("#")) + comment_text = comment_text.rstrip() curses.doupdate() - if comment_text is None or comment_text.isspace(): + if not comment_text: curses.flash() return