|
5 | 5 | import re |
6 | 6 | import copy |
7 | 7 |
|
8 | | -from NodeGraphQt import QtCore, QtWidgets, QtGui |
9 | | -from NodeGraphQt.base.commands import (NodeAddedCmd, |
10 | | - NodeRemovedCmd, |
11 | | - NodeMovedCmd, |
12 | | - PortConnectedCmd) |
13 | | -from NodeGraphQt.base.factory import NodeFactory |
14 | | -from NodeGraphQt.base.menu import NodeGraphMenu, NodesMenu |
15 | | -from NodeGraphQt.base.model import NodeGraphModel |
16 | | -from NodeGraphQt.base.node import NodeObject, BaseNode |
17 | | -from NodeGraphQt.base.port import Port |
18 | | -from NodeGraphQt.constants import (DRAG_DROP_ID, |
19 | | - PIPE_LAYOUT_CURVED, |
20 | | - PIPE_LAYOUT_STRAIGHT, |
21 | | - PIPE_LAYOUT_ANGLE, |
22 | | - IN_PORT, OUT_PORT) |
23 | | -from NodeGraphQt.widgets.viewer import NodeViewer |
| 8 | +from .. import QtCore, QtWidgets, QtGui |
| 9 | +from .commands import (NodeAddedCmd, |
| 10 | + NodeRemovedCmd, |
| 11 | + NodeMovedCmd, |
| 12 | + PortConnectedCmd) |
| 13 | +from .factory import NodeFactory |
| 14 | +from .menu import NodeGraphMenu, NodesMenu |
| 15 | +from .model import NodeGraphModel |
| 16 | +from .node import NodeObject, BaseNode |
| 17 | +from .port import Port |
| 18 | +from ..constants import (DRAG_DROP_ID, |
| 19 | + PIPE_LAYOUT_CURVED, |
| 20 | + PIPE_LAYOUT_STRAIGHT, |
| 21 | + PIPE_LAYOUT_ANGLE, |
| 22 | + IN_PORT, OUT_PORT) |
| 23 | +from ..widgets.viewer import NodeViewer |
24 | 24 |
|
25 | 25 |
|
26 | 26 | class QWidgetDrops(QtWidgets.QWidget): |
@@ -119,6 +119,7 @@ class NodeGraph(QtCore.QObject): |
119 | 119 | :parameters: :str |
120 | 120 | :emits: new session path |
121 | 121 | """ |
| 122 | + |
122 | 123 | def __init__(self, parent=None): |
123 | 124 | super(NodeGraph, self).__init__(parent) |
124 | 125 | self.setObjectName('NodeGraphQt') |
@@ -204,7 +205,7 @@ def _on_property_bin_changed(self, node_id, prop_name, prop_value): |
204 | 205 | node = self.get_node_by_id(node_id) |
205 | 206 |
|
206 | 207 | # prevent signals from causing a infinite loop. |
207 | | - _exc = [float, int , str, bool, None] |
| 208 | + _exc = [float, int, str, bool, None] |
208 | 209 | if node.get_property(prop_name) != prop_value: |
209 | 210 | if type(node.get_property(prop_name)) in _exc: |
210 | 211 | value = prop_value |
@@ -351,7 +352,7 @@ def widget(self): |
351 | 352 | if self._widget is None: |
352 | 353 | self._widget = QWidgetDrops() |
353 | 354 | self._widget.import_session = self.import_session |
354 | | - |
| 355 | + |
355 | 356 | layout = QtWidgets.QVBoxLayout(self._widget) |
356 | 357 | layout.setContentsMargins(0, 0, 0, 0) |
357 | 358 | layout.addWidget(self._viewer) |
@@ -1087,7 +1088,7 @@ def import_session(self, file_path): |
1087 | 1088 | Args: |
1088 | 1089 | file_path (str): path to the serialized layout file. |
1089 | 1090 | """ |
1090 | | - |
| 1091 | + |
1091 | 1092 | file_path = file_path.strip() |
1092 | 1093 | if not os.path.isfile(file_path): |
1093 | 1094 | raise IOError('file does not exist.') |
|
0 commit comments