[Soc-2017-dev] Weekly Report #08 - Package Manager
Ellwood Zwovic
gandalf3 at blendermonkey.com
Sun Jul 23 11:17:38 CEST 2017
Here's my report from the wiki for this week:
https://wiki.blender.org/index.php/User:Gandalf3/GSoC_2017/Reports#Week_8
== Week 8 ==
What I did this week:
* Added tracking of installed packages, and an uninstall operator.
* Added installation/setup instructions to the
[https://developer.blender.org/diffusion/BPMA/browse/master/README.md
readme].
* Put a package repository containing blender's official addons up on
http://blendermonkey.com/bpkg/ for testing.
To try it out:
<ol>
<li>Clone blender and checkout the
[https://developer.blender.org/diffusion/B/browse/soc-2017-package_manager/
soc-2017-package_manager branch].</li>
<pre>
git clone git://git.blender.org/blender.git
cd blender
git checkout soc-2017-package_manager
</pre>
<li>[https://wiki.blender.org/index.php/Dev:Doc/Building_Blender
Build].</li>
<li>Clone the [https://developer.blender.org/diffusion/BPMA/repository
package manager addon repository]:</li>
<pre> git clone git://git.blender.org/blender-package-manager-addon.git
</pre>
<li>Install the addon. Copy (or symlink) the package_manager directory
contained within the cloned repository into
/path/to/blender/build/bin/2.78/scripts/addons/</li>
<li>Run blender</li>
<li>Open the user preferences, enable the addon and set the repository</li>
<li>Refresh, and switch to the "Packages" section.</li>
</ol>
The default repository can currently be changed in the addon's preferences
section (currently only accessible in the "Addons" section).
A local repository can be generated with the generate_repository script
found
in the addon repository. Example usage:
./generate_repository /path/to/packages --baseurl 'http://localhost/'
This will produce a repo.json file in the current directory, which can then
be copied to the server. The baseurl is prepended to the filename of each
package to form the package's url (so for example,
http://localhost/node_wrangler.py).
=== Questions ===
* I'm not sure how best to disable asynchronous operators while they are
running. The trick is, I want to allow multiple instances same operator
to be run at once, but not with the same parameters. This is so that a
user can click install on multiple different packages without waiting
for any one to complete, but double-clicking on one will not spawn two
install processes. I believe operators are only instantiated when they
are executed, so I can't store an instance variable to track the running
state. I thought of adding a class variable which holds a list of the
parameters of running operators. The operator poll() method could then
perform a check to see if the current operator's parameters are present
in this list, and if so, return false. However, surely there's a better way?
* Putting the package manager addon in a python package puts the addon
itself under a subdirectory, so blender won't recognize it when the
whole repository is placed in a submodule in scripts/addons. The blender
cloud addon also seems to have the same issue, how was this solved there?
* ideasman42: I was directed to ask you regarding this, but I haven't
managed to catch you in irc.. How do info header progress bars work? The
only thing I've found which seems connected to them is this
[https://docs.blender.org/api/blender_python_api_2_78_3/bpy.types.UILayout.html#bpy.types.UILayout.template_running_jobs
undocumented `template_running_jobs()`] method.
* I noticed that my `bpkg` subpackage isn't getting reloaded when
pressing F8, despite getting passed to `importlib.reload()`. Does anyone
know why this might be?
=== Plans for next week ===
* More code cleanup.
* Add addon preferences, enabling/disabling, and more filtering.
* Multiple repository support.
Continued from last week:
* Improve responsiveness/add progress displays, listen for abort signals
on longer-running subprocesses.
* Prevent subprocesses operators from being started multiple times.
More information about the Soc-2017-dev
mailing list