@post('/option/<taskid>/get')
def option_get(taskid):
 if (taskid not in DataStore.tasks):
  logger.warning(('[%s] Invalid task ID provided to option_get()' % taskid))
  return jsonize({'success': False, 'message': 'Invalid task ID'})
 option = request.json.get('option', '')
 if (option in DataStore.tasks[taskid].options):
  logger.debug(('[%s] Retrieved value for option %s' % (taskid, option)))
  return jsonize({'success': True, option: DataStore.tasks[taskid].get_option(option)})
 else:
  logger.debug(('[%s] Requested value for unknown option %s' % (taskid, option)))
  return jsonize({'success': False, 'message': 'Unknown option', option: 'not set'})

@ post ( '/option/<taskid>/get' ) def option_get ( taskid ) : if ( taskid not in DataStore . tasks ) : logger . warning ( ( '[%s] Invalid task ID provided to option_get()' % taskid ) ) return jsonize ( { 'success' : False , 'message' : 'Invalid task ID' } ) option = request . json . get ( 'option' , '' ) if ( option in DataStore . tasks [ taskid ] . options ) : logger . debug ( ( '[%s] Retrieved value for option %s' % ( taskid , option ) ) ) return jsonize ( { 'success' : True , option : DataStore . tasks [ taskid ] . get_option ( option ) } ) else : logger . debug ( ( '[%s] Requested value for unknown option %s' % ( taskid , option ) ) ) return jsonize ( { 'success' : False , 'message' : 'Unknown option' , option : 'not set' } )
get the value of an option for a certain task id .