preston.py 文件源码

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

项目:Preston 作者: Celeo 项目源码 文件源码
def __init__(self, key=None, code=None, user_agent='', cache=None):
        """
        This class is the base for access the XML API. Attributes
        can be called on it to build a path to an endpoint.

        Args:
            key (str) - optional authentication keyID
            code (str) - optional authentication vCode
            user_agent (str) - optional (recommended) User-Agent
                                to use when making web requests
            cache (preston.xmlapi.cache.Cache) - page cache

        Returns:
            None
        """
        self.cache = cache or Cache()
        self.user_agent = user_agent or 'Preston (github.com/Celeo/Preston)'
        self.session = requests.session()
        self.session.headers.update({'User-Agent': self.user_agent})
        self.key = key
        self.code = code
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号