Skip to content

Commit

Permalink
Added elipses to the comment payloads and added functionality for the…
Browse files Browse the repository at this point in the history
… `Deploy` model.
  • Loading branch information
joestump committed Sep 7, 2012
1 parent db758e8 commit 492900e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lookout/services/campfire.py
@@ -1,5 +1,3 @@
from lookout.base import ServiceBase
from pinder import Campfire, Room

class Service(ServiceBase):
"""
Expand All @@ -20,7 +18,7 @@ def send(self, payload):
message = '%s %s. commented "%s" on %s "%s" (#%s) %s' % (
payload['attributes']['created_by']['first_name'],
payload['attributes']['created_by']['last_name'][0],
payload['attributes']['body'][0:50],
'%s...' % payload['attributes']['body'][0:50],
payload['attributes']['item']['type'],
payload['attributes']['item']['title'],
payload['attributes']['item']['number'],
Expand Down Expand Up @@ -65,6 +63,12 @@ def send(self, payload):
payload['attributes']['item']['title'],
payload['attributes']['item']['number'],
payload['attributes']['item']['short_url'])
elif payload['model'] == 'Deploy':
message = '%s %s. deployed %s items to %s.' % (
payload['attributes']['user']['first_name'],
payload['attributes']['user']['last_name'][0],
len(payload['attributes']['items']),
payload['attributes']['environment'])
else:
message = None

Expand Down
8 changes: 7 additions & 1 deletion lookout/services/hipchat.py
Expand Up @@ -16,7 +16,7 @@ def send(self, payload):
message = '%s %s. commented "%s" on %s "%s" (#%s) %s' % (
payload['attributes']['created_by']['first_name'],
payload['attributes']['created_by']['last_name'][0],
payload['attributes']['body'][0:50],
'%s...' % payload['attributes']['body'][0:50],
payload['attributes']['item']['type'],
payload['attributes']['item']['title'],
payload['attributes']['item']['number'],
Expand Down Expand Up @@ -61,6 +61,12 @@ def send(self, payload):
payload['attributes']['item']['title'],
payload['attributes']['item']['number'],
payload['attributes']['item']['short_url'])
elif payload['model'] == 'Deploy':
message = '%s %s. deployed %s items to %s.' % (
payload['attributes']['user']['first_name'],
payload['attributes']['user']['last_name'][0],
len(payload['attributes']['items']),
payload['attributes']['environment'])
else:
message = None

Expand Down

0 comments on commit 492900e

Please sign in to comment.