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
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