Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py3 compatibility #21

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
32 changes: 16 additions & 16 deletions nodz_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,67 +20,67 @@
# Nodes
@QtCore.Slot(str)
def on_nodeCreated(nodeName):
print 'node created : ', nodeName
print('node created : ', nodeName)

@QtCore.Slot(str)
def on_nodeDeleted(nodeName):
print 'node deleted : ', nodeName
print('node deleted : ', nodeName)

@QtCore.Slot(str, str)
def on_nodeEdited(nodeName, newName):
print 'node edited : {0}, new name : {1}'.format(nodeName, newName)
print('node edited : {0}, new name : {1}'.format(nodeName, newName))

@QtCore.Slot(str)
def on_nodeSelected(nodesName):
print 'node selected : ', nodesName
print('node selected : ', nodesName)

@QtCore.Slot(str, object)
def on_nodeMoved(nodeName, nodePos):
print 'node {0} moved to {1}'.format(nodeName, nodePos)
print('node {0} moved to {1}'.format(nodeName, nodePos))

# Attrs
@QtCore.Slot(str, int)
def on_attrCreated(nodeName, attrId):
print 'attr created : {0} at index : {1}'.format(nodeName, attrId)
print('attr created : {0} at index : {1}'.format(nodeName, attrId))

@QtCore.Slot(str, int)
def on_attrDeleted(nodeName, attrId):
print 'attr Deleted : {0} at old index : {1}'.format(nodeName, attrId)
print('attr Deleted : {0} at old index : {1}'.format(nodeName, attrId))

@QtCore.Slot(str, int, int)
def on_attrEdited(nodeName, oldId, newId):
print 'attr Edited : {0} at old index : {1}, new index : {2}'.format(nodeName, oldId, newId)
print('attr Edited : {0} at old index : {1}, new index : {2}'.format(nodeName, oldId, newId))

# Connections
@QtCore.Slot(str, str, str, str)
def on_connected(srcNodeName, srcPlugName, destNodeName, dstSocketName):
print 'connected src: "{0}" at "{1}" to dst: "{2}" at "{3}"'.format(srcNodeName, srcPlugName, destNodeName, dstSocketName)
print('connected src: "{0}" at "{1}" to dst: "{2}" at "{3}"'.format(srcNodeName, srcPlugName, destNodeName, dstSocketName))

@QtCore.Slot(str, str, str, str)
def on_disconnected(srcNodeName, srcPlugName, destNodeName, dstSocketName):
print 'disconnected src: "{0}" at "{1}" from dst: "{2}" at "{3}"'.format(srcNodeName, srcPlugName, destNodeName, dstSocketName)
print('disconnected src: "{0}" at "{1}" from dst: "{2}" at "{3}"'.format(srcNodeName, srcPlugName, destNodeName, dstSocketName))

# Graph
@QtCore.Slot()
def on_graphSaved():
print 'graph saved !'
print('graph saved !')

@QtCore.Slot()
def on_graphLoaded():
print 'graph loaded !'
print('graph loaded !')

@QtCore.Slot()
def on_graphCleared():
print 'graph cleared !'
print('graph cleared !')

@QtCore.Slot()
def on_graphEvaluated():
print 'graph evaluated !'
print('graph evaluated !')

# Other
@QtCore.Slot(object)
def on_keyPressed(key):
print 'key pressed : ', key
print('key pressed : ', key)

nodz.signal_NodeCreated.connect(on_nodeCreated)
nodz.signal_NodeDeleted.connect(on_nodeDeleted)
Expand Down Expand Up @@ -190,7 +190,7 @@ def on_keyPressed(key):


# Graph
print nodz.evaluateGraph()
print(nodz.evaluateGraph())

nodz.saveGraph(filePath='Enter your path')

Expand Down
Loading