def write_script(self, ws_path, step):
"""
Generate the script for the specified StudyStep.
:param ws_path: Workspace path for the step.
:param step: An instance of a StudyStep class.
:returns: A tuple containing a boolean set to True if step should be
scheduled (False otherwise), path to the generate script, and path
to the generated restart script (None if step cannot be restarted).
"""
to_be_scheduled, script_path, restart_path = \
self._write_script(ws_path, step)
st = os.stat(script_path)
os.chmod(script_path, st.st_mode | stat.S_IXUSR)
if restart_path:
st = os.stat(restart_path)
os.chmod(restart_path, st.st_mode | stat.S_IXUSR)
return to_be_scheduled, script_path, restart_path
评论列表
文章目录