Пример #1
0
def get_smart_client(record_id):
    """ Initialize a new SmartClient and return it """

    try:
        client = SMARTClient(_ENDPOINT.get('app_id'), _ENDPOINT.get('url'),
                             _ENDPOINT)
    except Exception as e:
        logging.critical('Could not init SMARTClient: %s' % e)
        return

    client.record_id = record_id
    return client
Пример #2
0
def _init_smart_client(record_id=None):
    """ Returns the SMART client, configured accordingly. """
    try:
        client = SMARTClient(_ENDPOINT.get('app_id'), _ENDPOINT.get('url'),
                             _ENDPOINT)
    except Exception as e:
        logging.critical('Could not init SMARTClient: %s' % e)
        flask.abort(500)
        return

    # initial client setup doesn't require record_id
    client.record_id = record_id
    return client
Пример #3
0
def get_smart_client(record_id):
    """ Initialize a new SmartClient and return it """

    try:
        client = SMARTClient(_ENDPOINT.get('app_id'),
                             _ENDPOINT.get('url'),
                             _ENDPOINT)
    except Exception as e:
        logging.critical('Could not init SMARTClient: %s' % e)
        return

    client.record_id = record_id
    return client
Пример #4
0
def _init_smart_client(record_id=None):
    """ Returns the SMART client, configured accordingly. """
    try:
        client = SMARTClient(_ENDPOINT.get('app_id'),
                             _ENDPOINT.get('url'),
                             _ENDPOINT)
    except Exception as e:
        logging.critical('Could not init SMARTClient: %s' % e)
        flask.abort(500)
        return

    # initial client setup doesn't require record_id
    client.record_id = record_id
    return client
Пример #5
0
def _smart_client(api_base, record_id=None):
    """ Returns the SMART client, configured accordingly. """
    global _smart
    if _smart is None:
        try:
            _smart = SMARTClient(_ENDPOINT.get('app_id'), api_base, _ENDPOINT)
        except Exception, e:
            logging.critical("Could not init SMARTClient. " + str(e))