def send_messages(self, data, timeout=30, endpoint='/collab/start/'):
        """Send messages to server, along with user authentication."""
        address = 'https://{}{}'.format(self.COLLAB_SERVER, endpoint)
        params = {
            'client_name': 'ok-client',
            'client_version': client.__version__,
        }

        log.info('Sending messages to %s', address)
        try:
            r = requests.post(address, params=params, json=data, timeout=timeout)
            r.raise_for_status()
            return r.json()
        except (requests.exceptions.RequestException, requests.exceptions.BaseHTTPError, Exception) as ex:
            message = '{}: {}'.format(ex.__class__.__name__, str(ex))
            log.warning(message)
            print("There was an error connecting to the server."
                  "Run with --debug for more details")
        return
def send_messages ( self , data , timeout = 30 , endpoint = '/collab/start/' ) : address = 'https://{}{}' . format ( self . COLLAB_SERVER , endpoint ) params = { 'client_name' : 'ok-client' , 'client_version' : client . __version__ , } log . info ( 'Sending messages to %s' , address ) try : r = requests . post ( address , params = params , json = data , timeout = timeout ) r . raise_for_status ( ) return r . json ( ) except ( requests . exceptions . RequestException , requests . exceptions . BaseHTTPError , Exception ) as ex : message = '{}: {}' . format ( ex . __class__ . __name__ , str ( ex ) ) log . warning ( message ) print ( "There was an error connecting to the server." "Run with --debug for more details" ) return
Send messages to server, along with user authentication.