Esempio n. 1
0
 def build_path(self):
     if self._include_message_actions is False:
         return FetchMessages.FETCH_MESSAGES_PATH % (
             self.pubnub.config.subscribe_key,
             utils.join_channels(self._channels))
     else:
         return FetchMessages.FETCH_MESSAGES_WITH_ACTIONS_PATH % (
             self.pubnub.config.subscribe_key,
             utils.url_encode(self._channels[0]))
Esempio n. 2
0
    def encoded_params(self):
        params = {}

        if self._auth_keys:
            params['auth'] = utils.join_items_and_encode(self._auth_keys)

        if self._channels:
            params['channel'] = utils.join_channels(self._channels)

        if self._groups:
            params['channel-group'] = utils.join_items_and_encode(self._groups)

        return params
Esempio n. 3
0
 def build_path(self):
     return GetState.GET_STATE_PATH % (
         self.pubnub.config.subscribe_key,
         utils.join_channels(self._channels),
         utils.url_encode(self.pubnub.uuid)
     )
Esempio n. 4
0
File: leave.py Progetto: vtpp/python
 def build_path(self):
         return Leave.LEAVE_PATH % (self.pubnub.config.subscribe_key, utils.join_channels(self._channels))
 def build_path(self):
     return MessageCount.MESSAGE_COUNT_PATH % (
         self.pubnub.config.subscribe_key,
         utils.join_channels(self._channel)
     )
Esempio n. 6
0
 def build_path(self):
     if len(self._channels) == 0 and len(self._channel_groups) == 0:
         return HereNow.HERE_NOW_GLOBAL_PATH % self.pubnub.config.subscribe_key
     else:
         return HereNow.HERE_NOW_PATH % (self.pubnub.config.subscribe_key,
                                         utils.join_channels(self._channels))
Esempio n. 7
0
 def build_path(self):
         return SetState.SET_STATE_PATH % (
             self.pubnub.config.subscribe_key,
             utils.join_channels(self._channels),
             self.pubnub.uuid
         )
Esempio n. 8
0
 def build_path(self):
     channels = utils.join_channels(self._channels)
     return Subscribe.SUBSCRIBE_PATH % (self.pubnub.config.subscribe_key, channels)
Esempio n. 9
0
 def build_path(self):
     return GetState.GET_STATE_PATH % (self.pubnub.config.subscribe_key,
                                       utils.join_channels(self._channels),
                                       utils.url_encode(self._uuid))
Esempio n. 10
0
 def build_path(self):
     return SetState.SET_STATE_PATH % (self.pubnub.config.subscribe_key,
                                       utils.join_channels(self._channels),
                                       self.pubnub.uuid)
Esempio n. 11
0
 def build_path(self):
     channels = utils.join_channels(self._channels)
     return Subscribe.SUBSCRIBE_PATH % (self.pubnub.config.subscribe_key, channels)
Esempio n. 12
0
 def build_path(self):
     channels = utils.join_channels(self._channels)
     return Heartbeat.HEARTBEAT_PATH % (self.pubnub.config.subscribe_key, channels)
Esempio n. 13
0
 def build_path(self):
     channels = utils.join_channels(self._channels)
     return Heartbeat.HEARTBEAT_PATH % (self.pubnub.config.subscribe_key, channels)