I initially thought I could pass the traceback with the exception, but
it seems transmitting exceptions around with their tracebacks intact is
not so easy. There's a library which does this:
https://github.com/ionelmc/python-tblib
But this doesn't seem important enough to introduce a dependency..
This cleans up make_repo.py a bit, using file extensions to determine
file type.
This also loosens the testing repo generation, as the existing
test required matching a predifed expected output which had to be
updated on every change (essentially making it a moot test, as the
reference output was obtained from the functions output).
The new test just checks if the output has the same number of packages
as the input dir has addons.
Tips on how best to test these sorts of "higher level" functions (if at
all) would be welcome :)
Moved repo.json generation to make_repo.py
Package/addon parsing is getting a bit messy, this can be
cleaned up when we have a clearer idea of what a package is.
For now just make it work.
Added a docstring to every class and function, documenting arguments and return values. Also made a couple cleanup changes. Next cleanup-related change will be moving from urllib.requests to the requests module.
Downloading, parsing index.json, and installing add-ons all now are handled asynchronously using the asyncio module. These operations will no longer block Blender, allowing them to run in the background.
- Updated generate-json.py to support addons_contrib (previously ran into an unhandled UnicodeDecodeError).
- 'download_url' key now works; used with http://localhost:8000 for now.
- index.json generated with updated generate-json.py, now contains addons and addons_contrib.
- For now, add-ons are downloaded from http://localhost:8000/.
- Add-ons on the index.json (from blender.org gitweb) are only displayed if they are not installed locally, or installed in the USER path.
- Only .py add-ons are supported for now, but .zip add-ons will be supported next commit.
- Add-on directory name was not a proper identifier before.
- index.json was formatted incorrectly (missing commas); new version is generated with updated generate-json.py (which seems to fail for addons_contrib at the moment), and contains data for add-ons in addons repo.