Example #1
0
 def onopen(self, sock):
     logging.info('Beginning handshake')
     msg = util.stringify({
         'command': 'CONNECT',
         'data': {
             'session': [self.client_id, self.secret],
             'api_key': self.options['api_key'],
         }
     })
     sock.send(native_str(msg))
 def onopen(self, sock):
     logging.info('Beginning handshake')
     msg = util.stringify({
         'command': 'CONNECT',
         'data': {
             'session': [self.client_id, self.secret],
             'api_key': self.options['api_key'],
         }
     })
     sock.send(native_str(msg))
Example #3
0
 def send_command(self, command, data):
     msg = util.stringify({'command': command, 'data': data})
     logging.info('Sending %s', msg)
     self.sock.send(native_str(msg))
 def send_command(self, command, data):
     msg = util.stringify({'command': command, 'data': data})
     logging.info('Sending %s', msg)
     self.sock.send(native_str(msg))
Example #5
0
 def test_stringify_and_parse(self):
     data = {'a': 1, 'b': 'test code', 'c': {}, 'd': [1,False,None,'asdf',{'a': 1, 'b': 2}]}
     self.assertEqual(util.parse(util.stringify(data)), data)