Initial multiple repository support

And lots of code reshuffling which likely should've been done in
separate commits..
This commit is contained in:
Ellwood Zwovic
2017-08-12 19:36:39 -07:00
parent 7340d8dadb
commit 6691b0b226
8 changed files with 463 additions and 349 deletions

View File

@@ -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