Skip to content

Commit 6d30908

Browse files
committed
imports clean up
1 parent 8c3ed03 commit 6d30908

File tree

21 files changed

+52
-37
lines changed

21 files changed

+52
-37
lines changed

NodeGraphQt/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def __init__(self):
7676
try:
7777
from Qt import QtWidgets, QtGui, QtCore, QtCompat, QtOpenGL
7878
except ImportError as ie:
79-
print('NodeGraphQt: Can\'t import Qt module please install "Qt.py"\n'
80-
'pip install Qt.py')
79+
print('NodeGraphQt: Please install "Qt.py" : pip install Qt.py')
8180
raise ImportError(ie)
8281

8382
from .base.graph import NodeGraph, SubGraph

NodeGraphQt/base/commands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python
2+
from Qt import QtWidgets
3+
24
from .utils import minimize_node_ref_count
3-
from .. import QtWidgets
45
from ..constants import IN_PORT, OUT_PORT
56

67

NodeGraphQt/base/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
3+
import copy
34
import gc
45
import json
56
import os
67
import re
78

8-
import copy
9+
from Qt import QtCore, QtWidgets, QtGui
910

1011
from .commands import (NodeAddedCmd,
1112
NodeRemovedCmd,
@@ -16,7 +17,6 @@
1617
from .model import NodeGraphModel
1718
from .node import NodeObject, BaseNode
1819
from .port import Port
19-
from .. import QtCore, QtWidgets, QtGui
2020
from ..constants import (DRAG_DROP_ID,
2121
PIPE_LAYOUT_CURVED,
2222
PIPE_LAYOUT_STRAIGHT,

NodeGraphQt/base/menu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/python
22
from distutils.version import LooseVersion
33

4-
from .. import QtGui, QtCore
4+
from Qt import QtGui, QtCore
5+
56
from ..errors import NodeMenuError
67
from ..widgets.actions import BaseMenu, GraphAction, NodeAction
78

NodeGraphQt/base/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/python
22
from distutils.version import LooseVersion
33

4-
from .. import QtGui, QtCore
4+
from Qt import QtGui, QtCore
5+
56
from ..constants import (PIPE_LAYOUT_CURVED,
67
PIPE_LAYOUT_STRAIGHT,
78
PIPE_LAYOUT_ANGLE,

NodeGraphQt/qgraphics/node_abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22

3-
from .. import QtCore, QtWidgets
3+
from Qt import QtCore, QtWidgets
44

55
from ..constants import (Z_VAL_NODE, NODE_WIDTH, NODE_HEIGHT, ITEM_CACHE_MODE)
66

NodeGraphQt/qgraphics/node_backdrop.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/python
22

3-
from .. import QtGui, QtCore, QtWidgets
4-
from ..constants import (Z_VAL_PIPE,
5-
NODE_SEL_COLOR,
6-
NODE_SEL_BORDER_COLOR)
3+
from Qt import QtGui, QtCore, QtWidgets
4+
75
from .node_abstract import AbstractNodeItem
86
from .pipe import Pipe
97
from .port import PortItem
8+
from ..constants import (Z_VAL_PIPE,
9+
NODE_SEL_COLOR,
10+
NODE_SEL_BORDER_COLOR)
1011

1112

1213
class BackdropSizer(QtWidgets.QGraphicsItem):

NodeGraphQt/qgraphics/node_text_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .. import QtWidgets, QtCore, QtGui
1+
from Qt import QtWidgets, QtCore, QtGui
22

33

44
class NodeTextItem(QtWidgets.QGraphicsTextItem):

NodeGraphQt/widgets/node_space_bar.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from .. import QtWidgets, QtCore
2-
from . stylesheet import STYLE_SLASH_BUTTON, STYLE_NODE_BUTTON
1+
from Qt import QtWidgets, QtCore
2+
3+
from .stylesheet import STYLE_SLASH_BUTTON, STYLE_NODE_BUTTON
34

45

56
class node_space_bar(QtWidgets.QWidget):

NodeGraphQt/widgets/node_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
3-
from .. import QtWidgets, QtCore
4-
from ..constants import DRAG_DROP_ID
3+
from Qt import QtWidgets, QtCore
54

5+
from ..constants import DRAG_DROP_ID
66

77
TYPE_NODE = QtWidgets.QTreeWidgetItem.UserType + 1
88
TYPE_CATEGORY = QtWidgets.QTreeWidgetItem.UserType + 2

0 commit comments

Comments
 (0)