How to use the aiogithubapi.AIOGitHubAuthentication function in aiogithubapi

To help you get started, we’ve selected a few aiogithubapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github to4ko / myconfig / custom_components / hacs / setup.py View on Github external
try:
        repository = hacs().get_by_name("hacs/integration")
        if repository is None:
            await hacs().register_repository("hacs/integration", "integration")
            repository = hacs().get_by_name("hacs/integration")
        if repository is None:
            raise AIOGitHubException("Unknown error")
        repository.status.installed = True
        repository.versions.installed = VERSION
        repository.status.new = False
        hacs.repo = repository.repository_object
        hacs.data_repo = await hacs().github.get_repo("hacs/default")
    except (
        AIOGitHubException,
        AIOGitHubRatelimit,
        AIOGitHubAuthentication,
    ) as exception:
        hacs.logger.critical(f"[{exception}] - Could not load HACS!")
        return False
    return True
github DavidFW1960 / home-assistant / custom_components / hacs / setup.py View on Github external
try:
        repository = hacs().get_by_name("hacs/integration")
        if repository is None:
            await hacs().register_repository("hacs/integration", "integration")
            repository = hacs().get_by_name("hacs/integration")
        if repository is None:
            raise AIOGitHubException("Unknown error")
        repository.status.installed = True
        repository.versions.installed = VERSION
        repository.status.new = False
        hacs.repo = repository.repository_object
        hacs.data_repo = await hacs().github.get_repo("hacs/default")
    except (
        AIOGitHubException,
        AIOGitHubRatelimit,
        AIOGitHubAuthentication,
    ) as exception:
        hacs.logger.critical(f"[{exception}] - Could not load HACS!")
        return False
    return True
github aneisch / home-assistant-config / custom_components / hacs / setup.py View on Github external
try:
        repository = hacs().get_by_name("hacs/integration")
        if repository is None:
            await hacs().register_repository("hacs/integration", "integration")
            repository = hacs().get_by_name("hacs/integration")
        if repository is None:
            raise AIOGitHubException("Unknown error")
        repository.status.installed = True
        repository.versions.installed = VERSION
        repository.status.new = False
        hacs.repo = repository.repository_object
        hacs.data_repo = await hacs().github.get_repo("hacs/default")
    except (
        AIOGitHubException,
        AIOGitHubRatelimit,
        AIOGitHubAuthentication,
    ) as exception:
        hacs.logger.critical(f"[{exception}] - Could not load HACS!")
        return False
    return True
github DavidFW1960 / home-assistant / custom_components / hacs / config_flow.py View on Github external
async def _test_token(self, token):
        """Return true if token is valid."""
        try:
            session = aiohttp_client.async_get_clientsession(self.hass)
            client = AIOGitHub(token, session)
            await client.get_repo("hacs/org")
            return True
        except (AIOGitHubException, AIOGitHubAuthentication) as exception:
            _LOGGER.error(exception)
        return False
github maartenpaauw / home-assistant-config / config / custom_components / hacs / config_flow.py View on Github external
async def _test_token(self, token):
        """Return true if token is valid."""
        try:
            session = aiohttp_client.async_get_clientsession(self.hass)
            client = AIOGitHub(token, session)
            await client.get_repo("custom-components/hacs")
            return True
        except (AIOGitHubException, AIOGitHubAuthentication):
            pass
        return False