Python aiohttp 模块,__version__() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用aiohttp.__version__()

项目:strawpoll.py    作者:PapyrusThePlant    | 项目源码 | 文件源码
def __init__(self, loop=None, requests_policy=RequestsPolicy.asynchronous):
        self.loop = loop if loop is not None else asyncio.get_event_loop()
        self.requests_policy = requests_policy

        # Build our default headers
        fmt = '{0}/{1} ({2}) Python/{3.major}.{3.minor}.{3.micro} aiohttp/{4} requests/{5}'
        user_agent = fmt.format(__title__, __version__, __url__, version_info, aiohttp.__version__, requests.__version__)
        self.default_headers = {'User-Agent': user_agent}

        # Prepare the sessions
        self.session_async = aiohttp.ClientSession(loop=loop, headers=self.default_headers)
        self.session_sync = requests.Session()
        self.session_sync.headers = self.default_headers
项目:tomodachi    作者:kalaspuff    | 项目源码 | 文件源码
def version_command(self) -> None:
        print('tomodachi/{}'.format(tomodachi.__version__))
        sys.exit(0)
项目:tomodachi    作者:kalaspuff    | 项目源码 | 文件源码
def dependency_versions_command(self) -> None:
        import aiobotocore
        import botocore
        import aiohttp
        import aioamqp
        print('aiobotocore/{}'.format(aiobotocore.__version__))
        print('botocore/{}'.format(botocore.__version__))
        print('aiohttp/{}'.format(aiohttp.__version__))
        print('aioamqp/{}'.format(aioamqp.__version__))
        sys.exit(0)