Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
edouard committed Mar 23, 2009
0 parents commit 349d38b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions campfirelistener/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#campfirelistener module
from campfirelistener import *
27 changes: 27 additions & 0 deletions campfirelistener/campfirelistener.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import sys
import pinder
from trac.core import *
from trac.ticket.api import ITicketChangeListener

class CampfireListener(Component):
implements(ITicketChangeListener)

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))

except:
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]))

def ticket_deleted(self, ticket):
self._sendText(ticket.id, "Ticket deleted")
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from setuptools import setup

setup(
name='TracCampfireListener', version='0.1',
packages=['campfirelistener'],
entry_points = {
'trac.plugins' : [
'campfirelistener.campfirelistener = campfirelistener.campfirelistener'
]
},
)

0 comments on commit 349d38b

Please sign in to comment.