Skip to content

Commit 308f9ca

Browse files
committed
clean up and doc clean up
1 parent 25dc3ab commit 308f9ca

File tree

9 files changed

+19
-7
lines changed

9 files changed

+19
-7
lines changed

NodeGraphQt/base/graph.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def __init__(self, parent=None, tab_search_key='tab'):
5959

6060
self._wire_signals()
6161

62+
def __repr__(self):
63+
return '<{} object at {}>'.format(self.__class__.__name__, hex(id(self)))
64+
6265
def _wire_signals(self):
6366
# internal signals.
6467
self._viewer.search_triggered.connect(self._on_search_triggered)

NodeGraphQt/base/menu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ def __init__(self, viewer, qmenu):
1616

1717
def __repr__(self):
1818
cls_name = self.__class__.__name__
19-
return '<NodeGraphQt.{}(\'{}\') @ {}>'.format(
20-
cls_name, self.name(), hex(id(self)))
19+
return '<{}("{}") object at {}>'.format(cls_name, self.name(), hex(id(self)))
2120

2221
@property
2322
def qmenu(self):

NodeGraphQt/base/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def __init__(self, node=None):
5050
self._view.id = self._model.id
5151

5252
def __repr__(self):
53-
return '<{}(\'{}\') @ {}>'.format(
54-
self.type_, self.NODE_NAME, hex(id(self)))
53+
return '<{}("{}") object at {}>'.format(
54+
self.__class__.__name__, self.NODE_NAME, hex(id(self)))
5555

5656
@classproperty
5757
def type_(cls):

NodeGraphQt/base/port.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, node, port):
2020

2121
def __repr__(self):
2222
port = str(self.__class__.__name__)
23-
return 'NodeGraphQt.{}(\'{}\')'.format(port, self.name())
23+
return '<{}("{}") object at {}>'.format(port, self.name(), hex(id(self)))
2424

2525
@property
2626
def view(self):

NodeGraphQt/widgets/node_tree.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def __init__(self, parent=None):
2323
self._factory = None
2424
self._custom_labels = {}
2525

26+
def __repr__(self):
27+
return '<{} object at {}>'.format(self.__class__.__name__, hex(id(self)))
28+
2629
def mimeData(self, items):
2730
node_ids = ','.join(i.toolTip(0) for i in items)
2831
mime_data = super(NodeTreeWidget, self).mimeData(items)

NodeGraphQt/widgets/properties_bin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def __init__(self, parent=None):
7979
layout.addLayout(top_layout)
8080
layout.addWidget(self._prop_list, 1)
8181

82+
def __repr__(self):
83+
return '<{} object at {}>'.format(self.__class__.__name__, hex(id(self)))
84+
8285
def __on_prop_close(self, node_id):
8386
items = self._prop_list.findItems(node_id, QtCore.Qt.MatchExactly)
8487
[self._prop_list.removeRow(i.row()) for i in items]

NodeGraphQt/widgets/tab_search.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def __init__(self, parent=None, node_dict=None):
7171
popup.clicked.connect(self._on_search_submitted)
7272
self.returnPressed.connect(self._on_search_submitted)
7373

74+
def __repr__(self):
75+
return '<{} at {}>'.format(self.__class__.__name__, hex(id(self)))
76+
7477
def _on_search_submitted(self, index=0):
7578
node_type = self._node_dict.get(self.text())
7679
if node_type:

docs/overview.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Navigation
1717
| Pan | *Alt + LMB + Drag* or *MMB + Drag* |
1818
+---------------+----------------------------------------------+
1919

20-
Search
21-
======
20+
Node Search
21+
===========
2222

2323
.. image:: _images/node_search.png
2424
:width: 269px

example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,5 @@ def show_nodes_list(node):
114114
menu_node.set_input(0, bar_node.output(1))
115115
bar_node.set_input(0, text_node.output(0))
116116

117+
117118
app.exec_()

0 commit comments

Comments
 (0)