-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decorator for Node GUIs and GUI deferred loading #174
Conversation
commit 783f371 Merge: c8e1147 3043123 Author: George Papadoulis <[email protected]> Date: Fri Nov 24 23:11:25 2023 +0200 Merge remote-tracking branch 'upstream/master' into gui_dev commit 3043123 Merge: 998e552 af91367 Author: Leon Thomm <[email protected]> Date: Fri Nov 24 22:02:44 2023 +0100 Merge pull request leon-thomm#171 from HeftyCoder/master This PR - adds sub-package functionality (`export_sub_nodes()`) (WIP) - adds a tree view for (sub-)packages - introduces dockable widgets - adds project-persistent window geometry - makes connections selectable commit c8e1147 Author: George Papadoulis <[email protected]> Date: Fri Nov 24 19:06:28 2023 +0200 Update utils.py commit 39fa412 Author: George Papadoulis <[email protected]> Date: Fri Nov 24 18:58:39 2023 +0200 Defer GUI loading -Implemented a on_gui_load decorator which defers Node GUI loading -Added a protection mechanism for when defining a GUI for the same node twice commit 00427cf Merge: caf6f88 1e9ddd0 Author: George Papadoulis <[email protected]> Date: Fri Nov 24 14:41:44 2023 +0200 Merge branch 'master' into gui_dev commit caf6f88 Author: George Papadoulis <[email protected]> Date: Mon Nov 20 15:45:17 2023 +0200 Implemented decorator GUI import -Defined a node_gui decorator in gui_env that allows for connecting the node to the gui -Defined a function in gui_env that returns if Ryven is in gui mode -Re-factored the packages to work with the new decorator system -Added a decorator to defer gui functions for package importing -Added a api.py for convenience. Might not be needed later
-Fixed styling
Please correct me if I'm missing something but I think your |
Clarifying the previous comment: Ryven can run in environments where Qt is not even installed (because it can't without desktop environment). That's why Footnotes
|
- fixes Qt imports - fixes circular imports - improve structure - improves help docstrings tested headless on basic example
I took the liberty to fix the imports and remove |
-Fixed wrong type hinting in consume_last_exported_package. Also cleaned the code and probably made the function a bit more performant.
I was (and probably still am) confused about how python importing works. I thought that by calling I made minor changes to the |
Importing a module just means running it. A module-level expression such as |
This PR introduces a new way to assign Node GUIs to Nodes. Specifically:
node_gui
which accepts a Node as a parameter. Assigning a gui to a node happens in thegui.py
file and not thenodes.py
, allowing for IDE hinting and deprecating the need for theimport_guis
andexport_guis
functions.on_gui_load
function which can be applied to any function in the importednodes.py
file. This function will then be called after package loading inimport_nodes_package
.Adds aBad idea, read the conversation for details.api.py
file in the ryven folder. Might not be needed, but thought it was a good idea.The
built_in
package and thepkg_test
package (which haslinalg
andstd
subpackages) have been changed to use this new utility. The olderlinalg
andstd
packages haven't been altered and are working with the "deprecated" functions.CC: these ideas were first discussed in #171 as a result of investigating sub-packages