summaryrefslogtreecommitdiffstats
path: root/superkaramba/examples/graph/graph.py
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-11-11 17:41:30 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-11-13 12:09:49 +0900
commitda9cd0c056c8275033fca84a1c8d49a8edb0c8ee (patch)
tree2521f74c0b2868d82518e13053fb01cc179e9a23 /superkaramba/examples/graph/graph.py
parent5dab6232ef3b3715630cf88eb40c4c6021e65f07 (diff)
downloadtdeutils-da9cd0c056c8275033fca84a1c8d49a8edb0c8ee.tar.gz
tdeutils-da9cd0c056c8275033fca84a1c8d49a8edb0c8ee.zip
superkaramba: convert examples to python3.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'superkaramba/examples/graph/graph.py')
-rw-r--r--superkaramba/examples/graph/graph.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/superkaramba/examples/graph/graph.py b/superkaramba/examples/graph/graph.py
index 5798612..56beab1 100644
--- a/superkaramba/examples/graph/graph.py
+++ b/superkaramba/examples/graph/graph.py
@@ -28,20 +28,20 @@ def widgetUpdated(widget):
if(graphs[0]):
karamba.deleteGraph(widget, graphs[0])
graphs[0] = 0
- print "Deleted graph."
+ print("Deleted graph.")
else:
graphs[0] = karamba.createGraph(widget, 0, 20, 400, 30, 400)
- print "Created graph: " + str(graphs[0])
+ print("Created graph: " + str(graphs[0]))
# size & resize
size = karamba.getGraphSize(widget, graphs[1])
- print "getGraphSize: " + str(size)
+ print("getGraphSize: " + str(size))
size = ((b * 200) + 200, size[1])
karamba.resizeGraph(widget, graphs[1], size[0], size[1])
# pos & move
pos = karamba.getGraphPos(widget, graphs[2])
- print "getGraphPos: " + str(pos)
+ print("getGraphPos: " + str(pos))
pos = (b * 200, pos[1])
karamba.moveGraph(widget, graphs[2], pos[0], pos[1])
@@ -53,7 +53,7 @@ def widgetUpdated(widget):
# Sensor
sensor = karamba.getGraphSensor(widget, graphs[4])
- print "getSensor: " + str(sensor)
+ print("getSensor: " + str(sensor))
if(b):
karamba.setGraphSensor(widget, graphs[4], 'SENSOR=NETWORK FORMAT="%in"')
else:
@@ -61,19 +61,19 @@ def widgetUpdated(widget):
# Min Max
minmax = karamba.getGraphMinMax(widget, graphs[5])
- print "getGraphMinMax: " + str(minmax)
+ print("getGraphMinMax: " + str(minmax))
minmax = (0, (b * 25) + 25)
karamba.setGraphMinMax(widget, graphs[5], minmax[0], minmax[1])
# Value
v = karamba.getGraphValue(widget, graphs[6])
- print "getGraphValue: ", v
+ print("getGraphValue: ", v)
v = (v + 1) % 30
karamba.setGraphValue(widget, graphs[6], v)
# Color
c = karamba.getGraphColor(widget, graphs[7])
- print "getGraphColor: ", c
+ print("getGraphColor: ", c)
r = (c[0] + 10) % 255
g = (c[1] + 10) % 255
bl = (c[2] + 10) % 255
@@ -86,4 +86,4 @@ def widgetMouseMoved(widget, x, y, button):
pass
# This will be printed when the widget loads.
-print "Loaded Graph test python extension!"
+print("Loaded Graph test python extension!")