Skip to content

Commit

Permalink
type import fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-thomm committed May 19, 2024
1 parent dea34d9 commit 97e498b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ryven-editor/ryven/gui/code_editor/CodePreviewWidget.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# prevent cyclic imports
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ryven.gui.main_window import MainWindow

from dataclasses import dataclass
from typing import Type, Optional, List

Expand All @@ -13,7 +19,6 @@
QPushButton
)

from ryven.gui.main_window import MainWindow
from ryven.gui.code_editor.EditSrcCodeInfoDialog import EditSrcCodeInfoDialog
from ryven.gui.code_editor.CodeEditorWidget import CodeEditorWidget
from ryven.gui.code_editor.SourceCodeUpdater import SrcCodeUpdater
Expand Down
2 changes: 1 addition & 1 deletion ryven-editor/ryven/main/packages/gui_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def node_gui(node_cls: Type[Node]):
raise Exception(f"{node_cls} is not of type {Node}")

def register_gui(gui_cls: Type[NodeGUI]):
assert hasattr(node_cls, 'GUI')
if node_cls in __explicit_nodes:
assert hasattr(node_cls, 'GUI')
InfoMsgs.write(f'{node_cls.__name__} has defined an explicit gui {node_cls.GUI.__name__}')
return
node_cls.GUI = gui_cls
Expand Down

0 comments on commit 97e498b

Please sign in to comment.