| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| available[:] = sorted(library.keys()) | ||
| library.update(_update_user_library(_base_library.copy())) | ||
| available[:] = sorted(name for name in library | ||
| if not name.startswith('_') or name not in _base_library) |
There was a problem hiding this comment.
Ok, so the idea is that we only exclude "_name" styles that are in the base library. Any other styles in the base library are shown, and any user styles are shown. I got that right?
Sorry, something went wrong.
There was a problem hiding this comment.
I would l go for: Exclude all styles with leading _. Not sure why users would register such styles, but let’s just document this way. It’s more in line with general underscore semantics , e.g. dir() and simpler to implement.
Sorry, something went wrong.
There was a problem hiding this comment.
Agreed. What if other libraries need to register their own "private" styles?
Sorry, something went wrong.
There was a problem hiding this comment.
My take: Private styles are those with a leading underscore. Everybody can register and get/use them. They are only not listed under the available styles. This is the same logic as with private attributes/methods.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, the only reason I wrote it this way is because the test adds a _test_ style and looks for it in available. But as I've now fixed reload_library to correctly clean up user styles, I think we can use any name in the test.
Sorry, something went wrong.
They remain in `style.library`, because that's how we look them up, but this prevents them being exposed as something someone might use. Also, fix `reload_library`, which was accidentally modifying the original base library information each time. Fixes itprojects/MasVisGtk#13
There was a problem hiding this comment.
Ok. Though, I think we should move away from "bunch of functions and variables" to a StyleRegistry concept, similar to ColormapRegistry.
Sorry, something went wrong.
|
I consider this a bug fix, so pointing to 3.10.x |
Sorry, something went wrong.
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
git checkout v3.10.x git pull
git cherry-pick -x -m1 b6777b14cdc1bf4503803eda2df79e7c60b84e6e
git commit -am "Backport PR #30235: Don't expose private styles in style.available"
git push YOURFORK v3.10.x:auto-backport-of-pr-30235-on-v3.10.x
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the Still Needs Manual Backport label once the PR gets merged. If these instructions are inaccurate, feel free to suggest an improvement. |
Sorry, something went wrong.
|
Not worth a manual backport. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR summary
They remain in style.library, because that's how we look them up, but this prevents them being exposed as something someone might use.
Also, fix reload_library, which was accidentally modifying the original base library information each time.
Fixes itprojects/MasVisGtk#13
PR checklist