-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 349d38b
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#campfirelistener module | ||
from campfirelistener import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
] | ||
}, | ||
) | ||
|