ftp.py 文件源码

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

项目:sqlalchemy-media 作者: pylover 项目源码 文件源码
def __init__(self, hostname, root_path, base_url,
                 username=None, password=None, passive=True, secure=False, **kwargs):

        if isinstance(hostname, FTP):
            self.ftp_client = hostname

        else:  # pragma: nocover
            if secure:
                self.ftp_client = FTP_TLS(host=hostname, user=username, passwd=password, **kwargs)
                # noinspection PyUnresolvedReferences
                self.ftp_client.prot_p()

            else:
                self.ftp_client = FTP(host=hostname, user=username, passwd=password, **kwargs)

            self.ftp_client.set_pasv(passive)

        self.root_path = root_path
        self.base_url = base_url.rstrip('/')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号