Initial multiple repository support
And lots of code reshuffling which likely should've been done in separate commits..
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
import logging
|
||||
__all__ = (
|
||||
"exceptions",
|
||||
"types",
|
||||
)
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
from . types import (
|
||||
Package,
|
||||
Repository,
|
||||
)
|
||||
from pathlib import Path
|
||||
|
||||
if 'bpy' in locals():
|
||||
import importlib
|
||||
|
||||
log.debug("Reloading %s", __name__)
|
||||
exceptions = importlib.reload(exceptions)
|
||||
Package = importlib.reload(types.Package)
|
||||
Repository = importlib.reload(types.Repository)
|
||||
|
||||
else:
|
||||
from . import exceptions
|
||||
from .types import (
|
||||
Package,
|
||||
Repository,
|
||||
)
|
||||
def load_repositories(repo_storage_path: Path) -> list:
|
||||
repositories = []
|
||||
for repofile in repo_storage_path.glob('*.json'):
|
||||
# try
|
||||
repo = Repository.from_file(repofile)
|
||||
# except
|
||||
repositories.append(repo)
|
||||
return repositories
|
||||
|
Reference in New Issue
Block a user