mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-16 02:25:10 +00:00
#743 - Trying to fix this.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
"""Helpers to get default repositories."""
|
||||
import json
|
||||
from aiogithubapi import AIOGitHub, AIOGitHubException
|
||||
from aiogithubapi import GitHub, AIOGitHubAPIException
|
||||
from integrationhelper import Logger
|
||||
from custom_components.hacs.hacsbase.exceptions import HacsException
|
||||
from custom_components.hacs.helpers.information import get_repository
|
||||
|
||||
|
||||
async def get_default_repos_orgs(github: type(AIOGitHub), category: str) -> dict:
|
||||
async def get_default_repos_orgs(github: type(GitHub), category: str) -> dict:
|
||||
"""Gets default org repositories."""
|
||||
repositories = []
|
||||
logger = Logger("hacs")
|
||||
@@ -22,7 +23,7 @@ async def get_default_repos_orgs(github: type(AIOGitHub), category: str) -> dict
|
||||
for repo in repos:
|
||||
repositories.append(repo.full_name)
|
||||
|
||||
except AIOGitHubException as exception:
|
||||
except AIOGitHubAPIException as exception:
|
||||
logger.error(exception)
|
||||
|
||||
return repositories
|
||||
@@ -38,7 +39,7 @@ async def get_default_repos_lists(session, token, default: str) -> dict:
|
||||
content = await repo.get_contents(default)
|
||||
repositories = json.loads(content.content)
|
||||
|
||||
except AIOGitHubException as exception:
|
||||
except (AIOGitHubAPIException, HacsException) as exception:
|
||||
logger.error(exception)
|
||||
|
||||
return repositories
|
||||
|
Reference in New Issue
Block a user