def __init__(self, is_running_in_docker, script_dir="demo_scripts", filename="README.md", is_simulation=True, is_automated=False, is_testing=False, is_fast_fail=True,is_learning = False, parent_script_dir = None, is_prep_only = False, is_prerequisite = False, output_format="log"):
"""
is_running_in_docker should be set to true is we are running inside a Docker container
script_dir is the location to look for scripts
filename is the filename of the script this demo represents
is_simulation should be set to true if we want to simulate a human running the commands
is_automated should be set to true if we don't want to wait for an operator to indicate it's time to execute the next command
is_testing is set to true if we want to compare actual results with expected results, by default execution will stop if any test fails (see is_fast_fail)
is_fast_fail should be set to true if we want to contnue running tests even after a failure
is_learning should be set to true if we want a human to type in the commands
parent_script_dir should be the directory of the script that calls this one, or None if this is the root script
is_prep_only should be set to true if we want to stop execution after all prerequisites are satsified
is_prerequisite indicates whether this is a prerequisite or not. It is used to decide behaviour with respect to simulation etc.
"""
self.mode = None
self.is_docker = is_running_in_docker
self.filename = filename
self.script_dir = ""
self.set_script_dir(script_dir)
self.is_simulation = is_simulation
self.is_automated = is_automated
self.is_testing = is_testing
self.is_fast_fail = is_fast_fail
self.is_learning = is_learning
self.current_command = ""
self.current_description = ""
self.last_command = ""
self.is_prep_only = is_prep_only
self.parent_script_dir = parent_script_dir
if self.parent_script_dir:
self.env = Environment(self.parent_script_dir, is_test = self.is_testing)
else:
self.env = Environment(self.script_dir, is_test = self.is_testing)
self.is_prerequisite = is_prerequisite
self.output_format = output_format
self.all_results = []
self.completed_validation_steps = []
评论列表
文章目录