In TracZephyrPlugin: Change how line wrapping works.
authorEvan Broder <broder@mit.edu>
Tue, 31 Mar 2009 19:12:57 +0000 (15:12 -0400)
committerEvan Broder <broder@mit.edu>
Tue, 31 Mar 2009 19:31:40 +0000 (15:31 -0400)
TracZephyrPlugin/ZephyrPlugin.py

index 320658e2632dabc900d749a3732b26cbdb2aab73..791b6a35a2603bb7d87e366088d8a20154fe9a1c 100644 (file)
@@ -14,12 +14,14 @@ class ZephyrPlugin(Component):
                               '-c', zclass,
                               '-i', 'trac-#%s' % id],
                              stdin=subprocess.PIPE)
-        p.stdin.write("\n".join(textwrap.wrap(message)).encode('utf-8', 'replace'))
+        p.stdin.write(message.encode('utf-8', 'replace'))
         p.stdin.close()
         p.wait()
     
     def ticket_created(self, ticket):
-        message = "%s filed a new ticket:\n%s\n\n%s" % (ticket['reporter'], ticket['summary'], ticket['description'][:255])
+        message = "%s filed a new ticket:\n%s\n\n%s" % (ticket['reporter'],
+                                                        ticket['summary'],
+                                                        textwrap.fill(ticket['description'][:255]))
         self.zwrite(ticket.id, message)
     
     def ticket_changed(self, ticket, comment, author, old_values):