Skip to content

Commit

Permalink
Merge pull request #167 from leon-thomm/pr166_tmp
Browse files Browse the repository at this point in the history
Fix accidental Qt backend import
  • Loading branch information
leon-thomm committed Oct 10, 2023
2 parents e15e4ff + 0c116d5 commit 081d92e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
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

0 comments on commit 081d92e

Please sign in to comment.