当前位置: 首页>>代码示例>>Python>>正文


Python aiohttp.__version__方法代码示例

本文整理汇总了Python中aiohttp.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python aiohttp.__version__方法的具体用法?Python aiohttp.__version__怎么用?Python aiohttp.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aiohttp的用法示例。


在下文中一共展示了aiohttp.__version__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_patches

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def test_patches():
    print("Botocore version: {} aiohttp version: {}".format(
        botocore.__version__, aiohttp.__version__))

    success = True
    for obj, digests in chain(_AIOHTTP_DIGESTS.items(), _API_DIGESTS.items()):
        digest = hashlib.sha1(getsource(obj).encode('utf-8')).hexdigest()
        if digest not in digests:
            print("Digest of {}:{} not found in: {}".format(
                obj.__qualname__, digest, digests))
            success = False

    assert success


# NOTE: this doesn't require moto but needs to be marked to run with coverage 
开发者ID:aio-libs,项目名称:aiobotocore,代码行数:18,代码来源:test_patches.py

示例2: main_page

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def main_page(request: web.Request) -> web.Response:
    """GET /api
    Description:
        Return simple JSON with useful info.
    Example:
        link: /api
    Returns:
        200: JSON with API info.
    Return Type:
        application/json
    """
    payload = {
        "aiohttp": aiohttp.__version__,
        "gd.py": gd.__version__,
        "python": platform.python_version(),
        "routes": list(parse_route_docs()),
    }

    return json_resp(payload) 
开发者ID:NeKitDS,项目名称:gd.py,代码行数:21,代码来源:server.py

示例3: version_command

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def version_command(self) -> None:
        print('tomodachi/{}'.format(tomodachi.__version__))
        sys.exit(0) 
开发者ID:kalaspuff,项目名称:tomodachi,代码行数:5,代码来源:__init__.py

示例4: __init__

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def __init__(self, connector=None, *, proxy=None, proxy_auth=None, loop=None, unsync_clock=True):
        self.loop = asyncio.get_event_loop() if loop is None else loop
        self.connector = connector
        self.__session = None # filled in static_login
        self._locks = weakref.WeakValueDictionary()
        self._global_over = asyncio.Event()
        self._global_over.set()
        self.token = None
        self.bot_token = False
        self.proxy = proxy
        self.proxy_auth = proxy_auth
        self.use_clock = not unsync_clock

        user_agent = 'DiscordBot (https://github.com/Rapptz/discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}'
        self.user_agent = user_agent.format(__version__, sys.version_info, aiohttp.__version__) 
开发者ID:Rapptz,项目名称:discord.py,代码行数:17,代码来源:http.py

示例5: user_agent

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def user_agent() -> str:
    template = "bandersnatch/{version} ({python}, {system})"
    template += f" (aiohttp {aiohttp.__version__})"
    version = __version__
    python = sys.implementation.name
    python += " {}.{}.{}-{}{}".format(*sys.version_info)
    uname = platform.uname()
    system = " ".join([uname.system, uname.machine])
    return template.format(**locals()) 
开发者ID:pypa,项目名称:bandersnatch,代码行数:11,代码来源:utils.py

示例6: test_user_agent

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def test_user_agent() -> None:
    assert re.match(
        r"bandersnatch/[0-9]\.[0-9]\.[0-9]\.?d?e?v?[0-9]? \(.*\) "
        + fr"\(aiohttp {aiohttp.__version__}\)",
        user_agent(),
    ) 
开发者ID:pypa,项目名称:bandersnatch,代码行数:8,代码来源:test_utils.py

示例7: collect_versions

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def collect_versions() -> Generator[str, None, None]:
    yield f"- python {version_from_info(sys.version_info)}"
    yield f"- gd.py {version_from_info(gd.version_info)}"
    yield f"- aiohttp v{aiohttp.__version__}"
    yield f"- click v{click.__version__}"
    yield "- system {0.system} {0.release} {0.version}".format(platform.uname())


# run main 
开发者ID:NeKitDS,项目名称:gd.py,代码行数:11,代码来源:__main__.py

示例8: get_default_agent

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def get_default_agent() -> str:
        string = "gd.py/{} python/{} aiohttp/{}"
        return string.format(gd.__version__, platform.python_version(), aiohttp.__version__) 
开发者ID:NeKitDS,项目名称:gd.py,代码行数:5,代码来源:http_request.py

示例9: __init__

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def __init__(self, app, client=None):
        if not client:
            config = app.get("ELASTIC_APM", {})
            config.setdefault("framework_name", "aiohttp")
            config.setdefault("framework_version", aiohttp.__version__)
            client = Client(config=config)
        app[CLIENT_KEY] = client
        self.app = app
        self.client = client
        self.install_tracing(app, client) 
开发者ID:elastic,项目名称:apm-agent-python,代码行数:12,代码来源:__init__.py

示例10: __init__

# 需要导入模块: import aiohttp [as 别名]
# 或者: from aiohttp import __version__ [as 别名]
def __init__(self, token, **kwargs):
        self.BASE = 'https://top.gg/api'
        self.token = token
        self.loop = asyncio.get_event_loop() if kwargs.get('loop') is None else kwargs.get('loop')
        self.session = kwargs.get('session') or aiohttp.ClientSession(loop=kwargs.get('loop'))
        self._global_over = asyncio.Event(loop=self.loop)
        self._global_over.set()

        user_agent = 'DBL-Python-Library (https://github.com/DiscordBotList/DBL-Python-Library {0}) Python/{1[0]}.{1[1]} aiohttp/{2}'
        self.user_agent = user_agent.format(__version__, sys.version_info, aiohttp.__version__)

    # TODO: better implementation of rate limits
    # NOTE: current implementation doesn't maintain state over restart 
开发者ID:DiscordBotList,项目名称:DBL-Python-Library,代码行数:15,代码来源:http.py


注:本文中的aiohttp.__version__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。