auth.py 文件源码

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

项目:pyatv 作者: postlund 项目源码 文件源码
def _send_plist(self, step, **kwargs):
        plist = dict((str(k), v) for k, v in kwargs.items())

        headers = copy(_AIRPLAY_HEADERS)
        headers['Content-Type'] = 'application/x-apple-binary-plist'

        # TODO: For some reason pylint does not find FMT_BINARY, why?
        # pylint: disable=no-member
        resp, code = yield from self.http.post_data(
            'pair-setup-pin',
            data=plistlib.dumps(plist, fmt=plistlib.FMT_BINARY))
        if code != 200:
            raise DeviceAuthenticationError(
                '{0} failed with code {1}'.format(step, code))
        return resp


# pylint: disable=too-few-public-methods
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号