我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用aiohttp.__version__()。
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
def version_command(self) -> None: print('tomodachi/{}'.format(tomodachi.__version__)) sys.exit(0)
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)