download.py 文件源码

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

项目:micromasters 作者: mitodl 项目源码 文件源码
def process(self):
        """
        Process response files
        """
        try:
            with self.sftp.cd(settings.EXAMS_SFTP_RESULTS_DIR):
                for remote_path, local_path in self.filtered_files():
                    try:
                        if self.process_zip(local_path):
                            self.sftp.remove(remote_path)

                        log.debug("Processed remote file: %s", remote_path)
                    except (EOFError, SSHException,):
                        raise
                    except:  # pylint: disable=bare-except
                        log.exception("Error processing file: %s", remote_path)
                    finally:
                        if os.path.exists(local_path):
                            os.remove(local_path)
        except (EOFError, SSHException,) as exc:
            raise RetryableSFTPException("Exception processing response files") from exc
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号