def QueryFollowed(device, logger, callback):
 def _OnResponse(response):
  response_dict = www_util.ParseJSONResponse(response)
  viewpoints = response_dict.get('viewpoints')
  if (len(viewpoints) < 1):
   logger.error('query_followed returned 0 viewpoints, should always return at least one.')
  else:
   logger.info('QueryFollowed scenario passed.')
  callback()
 device.SendRequest('service/query_followed', _OnResponse, 'POST', limit=5, headers={'version': message.MAX_SUPPORTED_MESSAGE_VERSION})

def QueryFollowed ( device , logger , callback ) : def _OnResponse ( response ) : response_dict = www_util . ParseJSONResponse ( response ) viewpoints = response_dict . get ( 'viewpoints' ) if ( len ( viewpoints ) < 1 ) : logger . error ( 'query_followed returned 0 viewpoints, should always return at least one.' ) else : logger . info ( 'QueryFollowed scenario passed.' ) callback ( ) device . SendRequest ( 'service/query_followed' , _OnResponse , 'POST' , limit = 5 , headers = { 'version' : message . MAX_SUPPORTED_MESSAGE_VERSION } )
simple scenario which calls the viewfinder services "query_followed" method .