torque.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:civet 作者: TheJacksonLaboratory 项目源码 文件源码
def _setup_script_dir(self, email_list):
        """
        setup the directory in the log_dir to hold all of the shell scripts we
        will generate.  Also write the epilogue script to this directory

        :param email_list:  we need the list of email addresses (usually a
            single address) when generating the epilogue script from the
            template
        """

        script_dir = os.path.join(self.log_dir, _SHELL_SCRIPT_DIR)
        try:
            os.makedirs(script_dir)
            os.chmod(script_dir, stat.S_IRWXU)

            if self.need_to_write_epilogue:
                with open(self.epilogue_filename, "w") as epilogue_file:
                    epilogue_file.write(self.generate_epilogue(email_list))
                os.chmod(self.epilogue_filename, stat.S_IRWXU)
                self.need_to_write_epilogue = False

        except OSError as exception:
            if exception.errno != errno.EEXIST:
                print('Error while creating directory ' + script_dir, file=sys.stderr)
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号