bodhi/controllers.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit ee69e5b0caff5845cb5ba889599787d7f8c2298b
Author: Ricky Zhou <ricky(a)fedoraproject.org>
Date: Tue Aug 4 11:50:09 2009 -0400
Wrap bodhi comments.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index dab5c90..03c5bbd 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -19,6 +19,7 @@ import time
import logging
import cherrypy
import xmlrpclib
+import textwrap
from cgi import escape
from koji import GenericError
@@ -998,7 +999,11 @@ class Root(controllers.RootController):
return dict(update=update, updates=[],
values={'title' : update.title},
comment_form=self.comment_captcha_form)
- if text == 'None': text = None
+ if text == 'None':
+ text = None
+ else:
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False).fill(text)
update.comment(text, karma, author=author, anonymous=True)
raise redirect(update.get_url())
@@ -1027,7 +1032,11 @@ class Root(controllers.RootController):
else:
try:
update = PackageUpdate.byTitle(title)
- if text == 'None': text = None
+ if text == 'None':
+ text = None
+ else:
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False).fill(text)
update.comment(text, karma)
if request_format() == 'json':
return dict(update=unicode(update))
Show replies by date