(taskid)
Get the value of an option (command line switch) for a certain task ID
Get the value of an option (command line switch) for a certain task ID
Get the value of an option ( command line switch ) for a certain task ID
def option_get(taskid):
    """
    Get the value of an option (command line switch) for a certain task ID
    """
    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"})
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" } )