X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/blobdiff_plain/99f25bfd883c4fabc145618937662b6abecf321d..a7c202e35cf46295abd47908631b8e3669a096e2:/TracZephyrPlugin/ZephyrPlugin.py diff --git a/TracZephyrPlugin/ZephyrPlugin.py b/TracZephyrPlugin/ZephyrPlugin.py index 679d019..673c339 100644 --- a/TracZephyrPlugin/ZephyrPlugin.py +++ b/TracZephyrPlugin/ZephyrPlugin.py @@ -19,6 +19,12 @@ 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] + signature = self.config.get('ZephyrPlugin', 'signature') + if signature: + command += ['-s', signature] p = subprocess.Popen(command + ['-c', zclass, '-i', 'trac-#%s' % id], @@ -35,9 +41,14 @@ 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'])) + ttype='ticket' + if ticket['type'] != 'defect': + ttype=ticket['type'] + message = "%s filed a new %s %s:\n%s\n\n%s" % (ticket['reporter'], + ticket['priority'], + ttype, + ticket['summary'], + self.format_text(ticket['description'])) self.zwrite(ticket.id, message) def ticket_changed(self, ticket, comment, author, old_values):