def _get_list_from_email_marketing_provider(sailthru_client):
 try:
  sailthru_get_response = sailthru_client.api_get('list', {})
 except SailthruClientError as exc:
  log.error('Exception attempting to get list from Sailthru - %s', unicode(exc))
  return {}
 if (not sailthru_get_response.is_ok()):
  error = sailthru_get_response.get_error()
  log.info('Error attempting to read list record from Sailthru: %s', error.get_message())
  return {}
 list_map = dict()
 for user_list in sailthru_get_response.json['lists']:
  list_map[user_list.get('name')] = user_list
 return list_map

def _get_list_from_email_marketing_provider ( sailthru_client ) : try : sailthru_get_response = sailthru_client . api_get ( 'list' , { } ) except SailthruClientError as exc : log . error ( 'Exception attempting to get list from Sailthru - %s' , unicode ( exc ) ) return { } if ( not sailthru_get_response . is_ok ( ) ) : error = sailthru_get_response . get_error ( ) log . info ( 'Error attempting to read list record from Sailthru: %s' , error . get_message ( ) ) return { } list_map = dict ( ) for user_list in sailthru_get_response . json [ 'lists' ] : list_map [ user_list . get ( 'name' ) ] = user_list return list_map
get sailthru list .