Skip to content
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

Fix accidental Qt backend import #167

Merged
merged 6 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions ryven-editor/ryven/main/Ryven.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,19 @@ def run(*args_,
-------
None|Main Window
"""

from ryven.node_env import init_node_env
from ryven.gui_env import init_node_guis_env # Qt dependency


# Process command line and method's arguments
conf: Config = process_args(use_sysargs, *args_, **kwargs)

#
# Qt application setup
#

# QtPy API
os.environ['QT_API'] = conf.qt_api

# Init environment
os.environ['RYVEN_MODE'] = 'gui'
os.environ['QT_API'] = conf.qt_api
from ryven.node_env import init_node_env
from ryven.gui_env import init_node_guis_env # Qt dependency
init_node_env()
init_node_guis_env()

Expand Down
2 changes: 1 addition & 1 deletion ryven-editor/ryven/main/args_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def parse_sys_args(just_defaults=False) -> Config:
# Display

group = parser.add_argument_group('display')

group.add_argument(
'-w', '--window-theme',
choices=Config.get_available_window_themes(),
Expand Down
10 changes: 7 additions & 3 deletions ryven-editor/ryven/main/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib
import os
from typing import Optional, Literal, List, Dict, Set, Union

from ryven import NodesPackage
Expand Down Expand Up @@ -45,9 +46,12 @@ def get_available_window_themes() -> Set[str]:

@staticmethod
def get_available_flow_themes() -> Set[str]:
# FIXME: this is not stable api; expose it properly in ryvencore-qt
from ryvencore_qt.src.Design import Design
return {t.name for t in Design().flow_themes}
# TODO: expose this in ryvencore_qt without requiring Qt import, since QT_API is not set yet
return {
"Toy", "Tron", "Ghost", "Blender", "Simple",
"Ueli", "pure dark", "colorful dark", "pure light",
"colorful light", "Industrial", "Fusion"
}

@staticmethod
def get_available_performance_modes() -> Set[str]:
Expand Down
2 changes: 1 addition & 1 deletion ryven-editor/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ryven
version = 3.4.0
version = 3.4.1
author = Leon Thomm
author_email = l.thomm@mailbox.org
description = Flow-based visual scripting for Python
Expand Down
2 changes: 1 addition & 1 deletion ryvencore-qt/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ryvencore-qt
version = v0.4.0
version = v0.4.1
author = Leon Thomm
author_email = l.thomm@mailbox.org
description = Qt frontend for ryvencore; Library for building Visual Node Editors
Expand Down
Loading