Include the trac summary in the Humbug subject.

(imported from commit 23298d8455e2b0e8c4947f2d2e76874b66a8e28c)
This commit is contained in:
Tim Abbott 2012-10-31 11:49:17 -04:00
parent 212a4e76d4
commit b9c54ed6f2
1 changed files with 6 additions and 1 deletions

View File

@ -29,8 +29,13 @@ def markdown_ticket_url(ticket, heading="ticket"):
def markdown_block(desc):
return "\n\n>" + "\n> ".join(desc.split("\n")) + "\n"
def truncate(string, length):
if len(string) <= length:
return string
return string[:length - 3] + "..."
def trac_subject(ticket):
return "Trac #%s" % ticket.id
return truncate("Trac #%s: %s" % (ticket.id, ticket.values.get("summary")), 60)
def send_update(ticket, content):
client.send_message({