file_transfer_plugin.py 文件源码

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

项目:phila-airflow 作者: CityOfPhiladelphia 项目源码 文件源码
def retrieve_file(self, remote_full_path, local_full_path_or_buffer):
        conn = self.get_conn()

        is_path = isinstance(local_full_path_or_buffer, basestring)

        if is_path:
            output_handle = open(local_full_path_or_buffer, 'wb')
        else:
            output_handle = local_full_path_or_buffer

        logging.info('Retrieving file from FTP: {}'.format(remote_full_path))
        conn.getfo(remote_full_path, output_handle)
        logging.info('Finished retrieving file from FTP: {}'.format(
            remote_full_path))

        if is_path:
            output_handle.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号