Store repository on window manager so it isn't saved in the .blend
We store it outside blender in JSON anyway, storing it two places at once could be confusing. We can move it back into the .blend later if it seems that would be preferred.
This commit is contained in:
@@ -310,10 +310,7 @@ class Repository:
|
||||
"""
|
||||
Read repository from a json file at `path`.
|
||||
"""
|
||||
try:
|
||||
repo_file = path.open('r', encoding='utf-8')
|
||||
except IOError as err:
|
||||
raise BadRepository from err
|
||||
repo_file = path.open('r', encoding='utf-8')
|
||||
|
||||
with repo_file:
|
||||
try:
|
||||
@@ -513,14 +510,12 @@ def refresh(pipe_to_blender, storage_path: pathlib.Path, repository_url: str):
|
||||
log = logging.getLogger(__name__ + '.refresh')
|
||||
|
||||
repo_path = storage_path / 'repo.json'
|
||||
try:
|
||||
if repo_path.exists():
|
||||
repo = Repository.from_file(repo_path)
|
||||
except BadRepository as err:
|
||||
log.warning("Failed to read existing repository: %s. Continuing download.", err)
|
||||
repo = Repository(repository_url)
|
||||
|
||||
if repo.url != repository_url:
|
||||
# We're getting a new repository
|
||||
if repo.url != repository_url:
|
||||
# We're getting a new repository
|
||||
repo = Repository(repository_url)
|
||||
else:
|
||||
repo = Repository(repository_url)
|
||||
|
||||
try:
|
||||
|
Reference in New Issue
Block a user