コード例 #1
0
ファイル: snippets.py プロジェクト: Khan/snippets
def _send_to_chat(msg, url_path):
    """Send a message to the main room/channel for active chat integrations."""
    try:
        app_settings = models.AppSettings.get()
    except ValueError:
        logging.warning('Not sending to chat: app settings not configured')
        return

    msg = "%s %s%s" % (msg, app_settings.hostname, url_path)

    hipchat_room = app_settings.hipchat_room
    if hipchat_room:
        hipchatlib.send_to_hipchat_room(hipchat_room, msg)

    slack_channel = app_settings.slack_channel
    if slack_channel:
        slacklib.send_to_slack_channel(slack_channel, msg)
コード例 #2
0
def _send_to_chat(msg, url_path):
    """Send a message to the main room/channel for active chat integrations."""
    try:
        app_settings = models.AppSettings.get()
    except ValueError:
        logging.warning('Not sending to chat: app settings not configured')
        return

    msg = "%s %s%s" % (msg, app_settings.hostname, url_path)

    hipchat_room = app_settings.hipchat_room
    if hipchat_room:
        hipchatlib.send_to_hipchat_room(hipchat_room, msg)

    slack_channel = app_settings.slack_channel
    if slack_channel:
        slacklib.send_to_slack_channel(slack_channel, msg)
コード例 #3
0
ファイル: snippets.py プロジェクト: hsingh23/snippets
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Weekly snippets are ready!'
            ' http://weekly-snippets.appspot.com/weekly')
     hipchatlib.send_to_hipchat_room('Khan Academy', msg)
コード例 #4
0
ファイル: snippets.py プロジェクト: hsingh23/snippets
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Reminder: Weekly snippets due today at 5pm.'
            ' http://weekly-snippets.appspot.com/')
     hipchatlib.send_to_hipchat_room('Khan Academy', msg)
コード例 #5
0
ファイル: snippets.py プロジェクト: jugoretz/snippets
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Weekly snippets are ready! '
            '<a href="http://macaulay-snippets.appspot.com/weekly">'
            'http://macaulay-snippets.appspot.com/weekly</a>')
     hipchatlib.send_to_hipchat_room('Macaulay Honors College', msg)
コード例 #6
0
ファイル: snippets.py プロジェクト: jugoretz/snippets
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Reminder: Weekly snippets due today at 5pm. '
            '<a href="http://macaulay-snippets.appspot.com/">'
            'http://macaulay-snippets.appspot.com/</a>')
     hipchatlib.send_to_hipchat_room('Macaulay Honors College', msg)
コード例 #7
0
ファイル: snippets.py プロジェクト: marcia/snippets
def _send_to_chat(msg):
    """Sends a message to the main room/channel for active chat integrations."""
    if _SEND_TO_HIPCHAT:
        hipchatlib.send_to_hipchat_room('Khan Academy', msg)
    if _SEND_TO_SLACK:
        slacklib.send_to_slack_channel('#khan-academy', msg)