Skip to content

Commit b4085c4

Browse files
committed
doc updates
1 parent 842a2bf commit b4085c4

File tree

9 files changed

+48
-36
lines changed

9 files changed

+48
-36
lines changed

NodeGraphQt/base/menu.py

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

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

2122
@property
2223
def qmenu(self):

NodeGraphQt/base/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def __init__(self, node):
2222
self.connected_ports = defaultdict(list)
2323

2424
def __repr__(self):
25-
return '{}(\'{}\')'.format(self.__class__.__name__, self.name)
25+
return '<{}(\'{}\') @ {}>'.format(
26+
self.__class__.__name__, self.name, hex(id(self)))
2627

2728
@property
2829
def to_dict(self):

NodeGraphQt/base/node.py

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

5252
def __repr__(self):
53-
return '{}(\'{}\')'.format(self.type_, self.NODE_NAME)
53+
return '<{}(\'{}\') @ {}>'.format(
54+
self.type_, self.NODE_NAME, hex(id(self)))
5455

5556
@classproperty
5657
def type_(cls):

NodeGraphQt/base/port.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class Port(object):
99
"""
10-
base class for a :class:`NodeGraphQt.Node` port.
10+
base class for a node port.
1111
1212
Args:
1313
node (NodeGraphQt.NodeObject): parent node.

NodeGraphQt/widgets/properties_bin.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class PropertiesBinWidget(QtWidgets.QWidget):
5454
#: Signal emitted (node_id, prop_name, prop_value)
5555
property_changed = QtCore.Signal(str, str, object)
5656

57-
def __init__(self, parent=None,):
57+
def __init__(self, parent=None):
5858
super(PropertiesBinWidget, self).__init__(parent)
5959
self.setWindowTitle('Properties Bin')
6060
self._prop_list = PropertiesList()
@@ -97,6 +97,15 @@ def limit(self):
9797
"""
9898
return int(self._limit.value())
9999

100+
def set_limit(self, limit):
101+
"""
102+
Set limit of nodes to display.
103+
104+
Args:
105+
limit (int): node limit.
106+
"""
107+
self._limit.setValue(limit)
108+
100109
def add_node(self, node):
101110
"""
102111
Add node to the properties bin.

docs/graph.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Node Graph
2-
**********
1+
Graph
2+
*****
33

44
**Inherited from:** :class:`PySide2.QtCore.QObject`
55

docs/menu.rst

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Menu & Commands
2-
***************
1+
Menus
2+
*****
33

4-
Here's a example where we a menu with the name "Foo" to the node graphs context menu.
4+
example adding "Foo" menu to the node graphs context menu.
55

66
.. code-block:: python
77
:linenos:
@@ -17,7 +17,7 @@ Here's a example where we a menu with the name "Foo" to the node graphs context
1717
# add a menu called "Foo".
1818
foo_menu = root_menu.add_menu('Foo')
1919
20-
and here we add a menu command with the name "Bar" to the "Foo" menu that will execute the ``my_test()`` method.
20+
add "Bar" command to the "Foo" menu.
2121

2222
.. code-block:: python
2323
:linenos:
@@ -30,15 +30,23 @@ and here we add a menu command with the name "Bar" to the "Foo" menu that will e
3030
# add "Bar" command to the "Foo" menu.
3131
foo_menu.add_command('Bar', my_test, 'Shift+t')
3232
33-
Simple Setup
34-
============
35-
36-
The ``NodeGraphQt`` module has a built in method that'll populate the node graphs context menu a few
37-
default menus and commands.
33+
Default Setup
34+
=============
3835

3936
.. image:: _images/menu_hotkeys.png
4037
:width: 50%
4138

39+
The ``NodeGraphQt.setup_context_menu`` has a built in function that'll populate the node graphs context menu a few
40+
default menus and commands.
41+
42+
.. code-block:: python
43+
:linenos:
44+
45+
from NodeGraphQt import NodeGraph, setup_context_menu
46+
47+
graph = NodeGraph()
48+
setup_context_menu(graph)
49+
4250
----
4351

4452
.. autofunction:: NodeGraphQt.setup_context_menu

docs/nodes.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ Object
99

1010
The ``NodeObject`` class is the main base class that all nodes inherit from.
1111

12-
----
13-
14-
.. note::
15-
These two attributes require reimplementing when subclassing any node object.
16-
17-
.. autoattribute:: NodeGraphQt.NodeObject.__identifier__
18-
.. autoattribute:: NodeGraphQt.NodeObject.NODE_NAME
19-
20-
2112
----
2213

2314
.. autoclass:: NodeGraphQt.NodeObject
2415
:members:
2516
:exclude-members: model, NODE_NAME
2617

18+
Attributes
19+
20+
.. autoattribute:: NodeGraphQt.NodeObject.__identifier__
21+
.. autoattribute:: NodeGraphQt.NodeObject.NODE_NAME
2722

2823
Node
2924
====

docs/overview.rst

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

20-
Tab Search
21-
==========
20+
Search
21+
======
2222

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

2626
Node can be created with the tab node search widget.
2727

28-
+-------------+--------+
29-
| action | hotkey |
30-
+=============+========+
31-
| Show Search | *Tab* |
32-
+-------------+--------+
33-
34-
.. note::
35-
To override the tab search widget hotkey see :class:`NodeGraphQt.NodeGraph` class for the tab_search_key argument.
28+
+-------------------+--------+
29+
| action | hotkey |
30+
+===================+========+
31+
| Toggle Visibility | *Tab* |
32+
+-------------------+--------+
3633

3734

3835
Properties Bin
@@ -59,7 +56,7 @@ The NodeGraphQt has a ``setup_context_menu`` method that'll setup the node graph
5956

6057
`(see line:32 in the example code below)`
6158

62-
see also: :ref:`Menu & Commands`
59+
see also: :ref:`Menus`
6360

6461

6562
Example

0 commit comments

Comments
 (0)