[Soc-2017-dev] Daily Report - Jul 11 - Package Manager

Ellwood Zwovic gandalf3 at blendermonkey.com
Thu Jul 13 22:11:29 CEST 2017


On 07/12/2017 12:39 AM, dr. Sybren A. Stüvel wrote:
> Hi Ellwood,
>
> On Wed, Jul 12, 2017 at 12:07:10AM -0700, Ellwood Zwovic wrote:
>> Today I added a basic install function. Basic, as in "copy/extract
>> the package into the destination directory".
> This functionality is already in Blender, and already written in
> Python, so you could just copy it into the add-on. If you have spent
> 8+ hours on this there must be more to tell about it than a single
> sentence. What exactly have you done?
>
I copied the existing code from the addon_install operator, then altered 
it to work in a subprocess.
So for example, error messages are sent to blender and handled there 
rather than being self.report()'ed directly.
>   What are you proud of you got in
> there? What did you struggle with? In what way is it different from
> what we had before?
>
>> I do have a question:
>> Currently the destination directory is just passed to the
>> subprocess, however really more than that is needed. The way addons
>> are currently installed, each scripts/addon directory is checked for
>> duplicates first. As I'd like to do the installation in a subprocess
>> to avoid locking blender's UI, all these paths have to be determined
>> there somehow. So, would it be reasonable to pass bpy (or just
>> bpy.utils.user_resource) to the subprocess? Are there any issues
>> with passing bpy around like this?
> I would just pass the list of paths to the subprocess. That'll
> probably work more reliable; I don't expect the bpy module to be
> picklable.
>
I tried passing just bpy.utils.user_resource, and that appears to have 
worked.
>   Also this keeps the "contract" between Blender and the
> subprocess simple.
>
Fair enough.
>> Tomorrow I'm planning to add my repository code back in, and if all
>> goes well, list the packages from the repositories in the GUI.
> Please focus on a single thing and finish the work you've worked on
> today first. The installation procedure also needs to be able to
> upgrade existing add-ons and perform a rollback when the installation
> fails.
>
>
>
> _______________________________________________
> Soc-2017-dev mailing list
> Soc-2017-dev at blender.org
> https://lists.blender.org/mailman/listinfo/soc-2017-dev
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/soc-2017-dev/attachments/20170713/e981518b/attachment.htm 


More information about the Soc-2017-dev mailing list