當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。