Skip to content

Commit

Permalink
Modified campfirelistener.py to support API tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Belchak committed May 11, 2010
1 parent 387aa30 commit 4a28996
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions campfirelistener/campfirelistener.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ class CampfireListener(Component):

def _sendText(self, ticketid, text):
try:
c = pinder.Campfire('campfire_subdomain')
c.login('email','password')
room = c.find_room_by_name('room')
room.speak("Trac: ticket #%i (http://url.to.your.trac.install/projects/project_name/ticket/%i) %s" % (ticketid, ticketid, text))
c = pinder.Campfire('SUBDOMAIN', 'API TOKEN')
room = c.room('ROOM ID')
room.speak("Trac: ticket #%i (http://trac.YOURDOMAIN.com/projects/PROJECT/ticket/%i) %s" % (ticketid, ticketid, text))

except:
print "Unexpected error:", sys.exc_info()[0]
print "Unexpected error:", sys.exc_info()[0]
return

def ticket_created(self, ticket):
self._sendText(ticket.id, "\"%s\" created by %s." % (ticket.values['summary'][0:100], ticket.values['reporter']))

def ticket_changed(self, ticket, comment, author, old_values):
self._sendText(ticket.id, "changed by %s, Comment: %s." % (author, comment[0:100]))
self._sendText(ticket.id, "changed by %s, Comment: %s." % (author, comment[0:100]))

def ticket_deleted(self, ticket):
self._sendText(ticket.id, "Ticket deleted")
self._sendText(ticket.id, "Ticket deleted")

0 comments on commit 4a28996

Please sign in to comment.