[Soc-2017-dev] Daily Report - Jul 13 - Package Manager
Ellwood Zwovic
gandalf3 at blendermonkey.com
Fri Jul 14 21:34:26 CEST 2017
On 07/14/2017 02:24 AM, dr. Sybren A. Stüvel wrote:
> Hi Ellwood,
>
> On 14/07/17 10:42, Ellwood Zwovic wrote:
>> Today I added repository fetching and a simple package browser interface.
> Let me copy-paste my response from two days ago:
>
> 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? 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 added a panel to the "Packages" section of the user preferences (added
in my branch). Currently the packages section coexists with the addons
section, but my plan is to be able to do just about everything the
addons section does from the packages section (so eventually they will
be merged).
I'm pretty happy with the way the interface design is working out so
far. I'd be interested hearing in any feedback from the UI team, though
it might be still a little early for that yet.
>
>> Some questions:
>>
>> I tried to find a way to have the packagelist be scroll-able
>> independently from the options on the side. Is there a way to allow,
>> say, a box to have its own scrollbar? The only element I found which
>> seems to come with a scrollbar is a UIlist. I haven't tried it yet, but
>> it doesn't quite seem appropriate (all the
> I wouldn't know about this directly off-hand, maybe someone else on the
> list can chime in? It feels like you're trying to create a scrolling box
> inside a scrolling box, which is generally a bad idea.
If both the "sidebar" and the packagelist are in their own scroll-box,
there will be no need for an outer scrollbar. So no nesting of
scrollbars, just parallel scrollbars. See for example how the
documentation
<https://docs.blender.org/manual/en/dev/modeling/meshes/introduction.html#properties-region>
scrolls (though this is not a perfect example, as the docs have an
IMO-strange scroll-linking behavior).
Perhaps I could put the sidebar in a toolshelf-style region?
>
>> I also noticed that the panel draw method is being called on scroll
>> events; seemingly causing degraded performance (in fact, I noticed this
>> with the current addon browser too). I can certainly do some things to
>> optimize the draw method, but I'm curious if there's a short explanation
>> of why this is. Is there actually a way for python to pick up on scroll
>> events and modify things meaningfully?
> As said before: focus on getting it working first. We can always
> optimise later.
Hence why I haven't started optimizing already. I'm merely curious what
the reason for this behavior is. Is draw() actually called every redraw?
Does the layout really need to be re-calculated every redraw (including
redraws due to scrolling)? How easy would it be/how much stuff would
break if draw() wasn't called on scroll? Would that give a free
performance boost to the UI everywhere? Or, more likely, am I just
missing something here?
This isn't a pertinent issue to the basic functionality of the package
manager, it's just a general question.
>
>> On a rather unrelated note, how strict are the requirements for the
>> bl_info dict? I've been thinking it would be nice to have a changelog
>> url.
> Again, focus on getting the package manager working first, and don't
> spend time doing extra things on the side.
>
>> Plans for tomorrow: clean up repository (I didn't get to it today),
> The repository is very small, so cleanup wouldn't take long. What were
> your reasons to not do this today as you said you would?
I ended up regularly using my old code for reference, and having it so
nearby was quite handy.
I'll move it to a non-git directory and get the best of both worlds.
>
>
> When I try to serve the generated repo.json file via "python3 -m
> http.server", use "http://localhost:8000/" as URL, and click the Refresh
> button, I get this error:
Ah, it currently expects the exact URL to the repo.json, so that should
be "http://localhost:8000/repo.json". The reason for the json error
seems to be that python returns a listing (in html) when given the URL
of a directory.
However, part of the reason for choosing a fixed name for the repo.json
file is so that it wouldn't need to be specified all the time. I'll see
about adding that (and generally adding proper error handling to the
refresh function) today.
>
> 2017-07-14 11:19:30,200 INFO bpkg_manager.BPKG_OT_refresh Starting
> 2017-07-14 11:19:30,214 WARNING bpkg_manager.subproc.refresh Failed to
> read existing repository: . Continuing download.
> Process Process-1:
> Traceback (most recent call last):
> File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in
> _bootstrap
> self.run()
> File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
> self._target(*self._args, **self._kwargs)
> File
> "/home/sybren/.config/blender/2.78/scripts/addons/bpkg_manager/subproc.py",
> line 500, in refresh
> repo.refresh()
> File
> "/home/sybren/.config/blender/2.78/scripts/addons/bpkg_manager/subproc.py",
> line 225, in refresh
> repodict = resp.json()
> File
> "/home/sybren/.local/lib/python3.5/site-packages/requests/models.py",
> line 826, in json
> return complexjson.loads(self.text, **kwargs)
> File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
> return _default_decoder.decode(s)
> File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
> obj, end = self.raw_decode(s, idx=_w(s, 0).end())
> File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
> raise JSONDecodeError("Expecting value", s, err.value) from None
> json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
> 2017-07-14 11:19:30,313 ERROR bpkg_manager.BPKG_OT_refresh Process
> died without telling us! Exit code was 1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/soc-2017-dev/attachments/20170714/bcf43ea3/attachment-0001.htm
More information about the Soc-2017-dev
mailing list