예제 #1
0
    def send_notification(self, project, message):
        url = self.get_option('url', project)
        token = self.get_option('token', project)
        rooms = self.get_option('rooms', project)
        play_sound = self.get_option('play_sound', project)
        sound = self.get_option('sound', project)

        # The appended slash causes a 404 error
        req = Request(url.strip('/'), token)
        campfire = Campfire(req)

        for r in rooms.split(','):
            if r:
                room = campfire.room(r)
                room.speak(message)
                if play_sound:
                    room.play(sound)
예제 #2
0
    def __init__(self, url, api_key, rooms=False, aws=False):

        self.url = url
        self.api_key = api_key

        request = Request(url, api_key)
        self.campfire = Campfire(request)

        self.account = self.campfire.account()
        self.available_rooms = self.campfire.rooms()

        self.user = self.campfire.user()

        if rooms:
            self.joinRooms(rooms)

        if aws:
            self.__awsInit(aws)

        self.__setActions()
예제 #3
0
 def setup_class(self):
     HTTPretty.enable()
     self.request = Request(campfire_url(), 'some_token')
     self.campfire = Campfire(self.request)
예제 #4
0
 def setup_class(self):
     HTTPretty.enable()
     self.request = Request(campfire_url(), 'some_token')
     self.campfire = Campfire(self.request)
     self.room_id = 27121983
     self.room = Room(self.request, self.room_id)
예제 #5
0
 def __init__(self, api_token, account):
     request = Request('https://%s.campfirenow.com' % account, api_token)
     self.campfire = Campfire(request)