[Downloader] Move author key handling to RepoJSONMixin, fix NameError (#3285)

* Update downloader.py

* Update json_mixins.py

* Update installable.py

* changelog pt 1

* changelog pt2

* edit of changelog pt1

* edit of changelog pt 2 (last commit before review)

* Kidding, this is the last one before review.
This commit is contained in:
jack1142
2020-01-08 19:08:55 +01:00
committed by Michael H
parent f5949f2664
commit af859aa755
5 changed files with 10 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ class RepoJSONMixin:
def __init__(self, repo_folder: Path):
self._repo_folder = repo_folder
self.author: Optional[Tuple[str, ...]] = None
self.author: Tuple[str, ...] = ()
self.install_msg: Optional[str] = None
self.short: Optional[str] = None
self.description: Optional[str] = None
@@ -32,7 +32,12 @@ class RepoJSONMixin:
else:
self._info = info
self.author = info.get("author")
try:
author = tuple(info.get("author", []))
except ValueError:
author = ()
self.author = author
self.install_msg = info.get("install_msg")
self.short = info.get("short")
self.description = info.get("description")