<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 07/12/2017 12:39 AM, dr. Sybren A. Stüvel wrote:<br>
    <blockquote type="cite"
      cite="mid:6c4d6c38-4c31-851f-cbe7-fef8f46dbcfb@blendermonkey.com">
      <pre wrap="">Hi Ellwood,

On Wed, Jul 12, 2017 at 12:07:10AM -0700, Ellwood Zwovic wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Today I added a basic install function. Basic, as in "copy/extract
the package into the destination directory".
</pre>
      </blockquote>
      <pre wrap="">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?</pre>
      <br>
    </blockquote>
    I copied the existing code from the addon_install operator, then
    altered it to work in a subprocess.<br>
    So for example, error messages are sent to blender and handled there
    rather than being self.report()'ed directly.<br>
    <blockquote type="cite"
      cite="mid:6c4d6c38-4c31-851f-cbe7-fef8f46dbcfb@blendermonkey.com">
      <pre wrap=""> 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?</pre>
      <br>
    </blockquote>
    <blockquote type="cite"
      cite="mid:6c4d6c38-4c31-851f-cbe7-fef8f46dbcfb@blendermonkey.com">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">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?
</pre>
      </blockquote>
      <pre wrap="">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.</pre>
      <br>
    </blockquote>
    I tried passing just bpy.utils.user_resource, and that appears to
    have worked.<br>
    <blockquote type="cite"
      cite="mid:6c4d6c38-4c31-851f-cbe7-fef8f46dbcfb@blendermonkey.com">
      <pre wrap=""> Also this keeps the "contract" between Blender and the
subprocess simple.</pre>
      <br>
    </blockquote>
    Fair enough.<br>
    <blockquote type="cite"
      cite="mid:6c4d6c38-4c31-851f-cbe7-fef8f46dbcfb@blendermonkey.com">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">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.
</pre>
      </blockquote>
      <pre wrap="">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.</pre>
      <br>
    </blockquote>
    <blockquote type="cite"
      cite="mid:6c4d6c38-4c31-851f-cbe7-fef8f46dbcfb@blendermonkey.com">
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Soc-2017-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Soc-2017-dev@blender.org" moz-do-not-send="true">Soc-2017-dev@blender.org</a>
<a class="moz-txt-link-freetext" href="https://lists.blender.org/mailman/listinfo/soc-2017-dev" moz-do-not-send="true">https://lists.blender.org/mailman/listinfo/soc-2017-dev</a>
</pre>
      <br>
    </blockquote>
    <br>
    <br>
    <br>
  </body>
</html>