]> snippets.scripts.mit.edu Git - Scripts/git/.git/blobdiff - TracZephyrPlugin/ZephyrPlugin.py
TracZephyrPlugin: Allow setting an opcode on outgoing zephyrs.
[Scripts/git/.git] / TracZephyrPlugin / ZephyrPlugin.py
index 679d019f962274877cc4bfb63e32cd3a905b6be8..aeaec986f583dc3c9347892a966b34e33f4c4d0b 100644 (file)
@@ -19,6 +19,9 @@ class ZephyrPlugin(Component):
         command = shlex.split(self.config.get('ZephyrPlugin', 'command').encode('utf-8'))
         if not command:
             command = ['zwrite', '-q', '-l', '-d']
+        opcode = self.config.get('ZephyrPlugin', 'opcode')
+        if opcode:
+            command += ['-O', opcode]
         p = subprocess.Popen(command +
                              ['-c', zclass,
                               '-i', 'trac-#%s' % id],
@@ -35,9 +38,10 @@ class ZephyrPlugin(Component):
         return '\n'.join(lines)
     
     def ticket_created(self, ticket):
-        message = "%s filed a new ticket:\n%s\n\n%s" % (ticket['reporter'],
-                                                        ticket['summary'],
-                                                        self.format_text(ticket['description']))
+        message = "%s filed a new %s ticket:\n%s\n\n%s" % (ticket['reporter'],
+                                                           ticket['priority'],
+                                                           ticket['summary'],
+                                                           self.format_text(ticket['description']))
         self.zwrite(ticket.id, message)
     
     def ticket_changed(self, ticket, comment, author, old_values):