tcex.py 文件源码

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

项目:tcex 作者: ThreatConnect-Inc 项目源码 文件源码
def results_tc_args(self):
        """Read data from results_tc file from previous run of app.

        This method is only required when not running from the with the
        TcEX platform and is only intended for testing apps locally.

        Returns:
            (dictionary): A dictionary of values written to results_tc.
        """
        results = []
        if os.access(self.default_args.tc_out_path, os.W_OK):
            result_file = '{}/results.tc'.format(self.default_args.tc_out_path)
        else:
            result_file = 'results.tc'

        if os.path.isfile(result_file):
            with open(result_file, 'r') as rh:
                results = rh.read().strip().split('\n')
            os.remove(result_file)

        for line in results:
            key, value = line.split(' = ')
            setattr(self.default_args, key, value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号