diff --git a/superkaramba/examples/autoHide/main.py b/superkaramba/examples/autoHide/main.py index 85e2b37..0dce2e0 100644 --- a/superkaramba/examples/autoHide/main.py +++ b/superkaramba/examples/autoHide/main.py @@ -18,7 +18,6 @@ def widgetUpdated(widget): hidden = 1 karamba.moveWidget(widget, 0, -210) - #This gets called everytime our widget is clicked. #Notes: # widget = reference to our widget @@ -33,21 +32,10 @@ def widgetUpdated(widget): def widgetClicked(widget, x, y, button): pass -#This gets called everytime our widget is clicked. -#Notes -# widget = reference to our widget -# x = x position (relative to our widget) -# y = y position (relative to our widget) -# botton = button being held: -# 0 = No Mouse Button -# 1 = Left Mouse Button -# 2 = Middle Mouse Button -# 3 = Right Mouse Button, but this will never happen -# because the right mouse button brings up the -# Karamba menu. +#This gets called everytime the mouse moves on the widget area +#Warning: Don't do anything too intensive here +#You don't want to run some complex piece of code everytime the mouse moves def widgetMouseMoved(widget, x, y, button): - #Warning: Don't do anything too intensive here - #You don't want to run some complex piece of code everytime the mouse moves global hidden global counter if (hidden==1): @@ -55,8 +43,6 @@ def widgetMouseMoved(widget, x, y, button): hidden = 0 counter = 0 - - # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/bar/bar.py b/superkaramba/examples/bar/bar.py index b018fe8..2ec029d 100644 --- a/superkaramba/examples/bar/bar.py +++ b/superkaramba/examples/bar/bar.py @@ -24,9 +24,9 @@ def widgetUpdated(widget): # vertical & bitmap b = karamba.getBarVertical(widget, bars[7]) - print "getVertical: " + str(b) + print("getVertical: " + str(b)) bmp = karamba.getBarImage(widget, bars[7]) - print "getBitmap: " + str(bmp) + print("getBitmap: " + str(bmp)) b = (b+1)%2 karamba.setBarVertical(widget, bars[7], b) if(b): @@ -38,13 +38,13 @@ def widgetUpdated(widget): # size & resize size = karamba.getBarSize(widget, bars[1]) - print "getBarSize: " + str(size) + print("getBarSize: " + str(size)) size = ((b * 100) + 100, size[1]) karamba.resizeBar(widget, bars[1], size[0], size[1]) # pos & move pos = karamba.getBarPos(widget, bars[2]) - print "getBarPos: " + str(pos) + print("getBarPos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveBar(widget, bars[2], pos[0], pos[1]) @@ -56,19 +56,19 @@ def widgetUpdated(widget): # Value v = karamba.getBarValue(widget, bars[5]) - print "getBarValue: ", v + print("getBarValue: ", v) v = (v + 10) % 110 karamba.setBarValue(widget, bars[5], v) # Min Max minmax = karamba.getBarMinMax(widget, bars[6]) - print "getBarMinMax: " + str(minmax) + print("getBarMinMax: " + str(minmax)) minmax = (0, (b * 100) + 100) karamba.setBarMinMax(widget, bars[6], minmax[0], minmax[1]) # Sensor sensor = karamba.getBarSensor(widget, bars[4]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setBarSensor(widget, bars[4], 'SENSOR=SENSOR TYPE="cpu_temp"') else: @@ -90,4 +90,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Bar test python extension!" +print("Loaded Bar test python extension!") diff --git a/superkaramba/examples/change_interval/interval.py b/superkaramba/examples/change_interval/interval.py index 6c3422a..6a72434 100644 --- a/superkaramba/examples/change_interval/interval.py +++ b/superkaramba/examples/change_interval/interval.py @@ -11,50 +11,53 @@ text = None #this is called when you widget is initialized def initWidget(widget): - - karamba.redrawWidget(widget) + global seq + global text + seq = 0 + text = None + karamba.redrawWidget(widget) # sequence drops down to zero and changes the time interval to 1 second. # keeps counting down thereafter... def widgetUpdated(widget): - global seq - global text + global seq + global text - seq -= 1 + seq -= 1 - if seq <= 0: - karamba.changeInterval(widget, 1000) + if seq <= 0: + karamba.changeInterval(widget, 1000) - if seq <= 0: - message = "biding-time seq:%d" % -seq - else: - message = "wiggle seq:%d" % seq + if seq <= 0: + message = "biding-time seq:%d" % -seq + else: + message = "wiggle seq:%d" % seq - # delete previous text if exists. - if text is not None: - karamba.deleteText(widget, text) + # delete previous text if exists. + if text is not None: + karamba.deleteText(widget, text) - # display new message - text = karamba.createText(widget, 0, 20, 300, 20, message) - karamba.changeTextColor(widget, text, 252,252,252) + # display new message + text = karamba.createText(widget, 0, 20, 300, 20, message) + karamba.changeTextColor(widget, text, 252,252,252) - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) # wiggle the mouse over the widget to get the sequence number increased more. # also set the refresh rate to 50ms so that the theme has to fight against # the wiggling. def widgetMouseMoved(widget, x, y, button): - global seq + global seq - if seq <= 0: - seq = 0 - karamba.changeInterval(widget, 50) + if seq <= 0: + seq = 0 + karamba.changeInterval(widget, 50) - seq += 1 - + seq += 1 + # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/control_management/mgmt.py b/superkaramba/examples/control_management/mgmt.py index eae98c2..2e43634 100644 --- a/superkaramba/examples/control_management/mgmt.py +++ b/superkaramba/examples/control_management/mgmt.py @@ -10,40 +10,40 @@ mgmt_txt = None #this is called when you widget is initialized def initWidget(widget): - global do_nothing_txt - global do_something_txt + global do_nothing_txt + global do_something_txt - # display new message - do_nothing_txt = karamba.createText(widget, 0, 00, 300, 20, - "Right mouse click me!") - karamba.changeTextColor(widget, do_nothing_txt, 252,252,252) - mgmt_txt = karamba.createText(widget, 0, 20, 300, 20, - "Righ mouse click me too!") - karamba.changeTextColor(widget, mgmt_txt, 252,252,252) + # display new message + do_nothing_txt = karamba.createText(widget, 0, 00, 300, 20, + "Right mouse click me!") + karamba.changeTextColor(widget, do_nothing_txt, 252,252,252) + mgmt_txt = karamba.createText(widget, 0, 20, 300, 20, + "Righ mouse click me too!") + karamba.changeTextColor(widget, mgmt_txt, 252,252,252) - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) - karamba.setWantRightButton(widget, 1) + karamba.setWantRightButton(widget, 1) def widgetUpdated(widget): - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) def widgetClicked(widget, x, y, button): - global do_nothing_txt + global do_nothing_txt - if y < 20: - if do_nothing_txt is not None: - karamba.deleteText(widget, do_nothing_txt) - do_nothing_txt = karamba.createText(widget, - 0, 0, 300, 20, "I don't do anything when clicking here.") - karamba.changeTextColor(widget, do_nothing_txt, - 255,200,200) - karamba.redrawWidget(widget) - return + if y < 20: + if do_nothing_txt is not None: + karamba.deleteText(widget, do_nothing_txt) + do_nothing_txt = karamba.createText(widget, + 0, 0, 300, 20, "I don't do anything when clicking here.") + karamba.changeTextColor(widget, do_nothing_txt, + 255,200,200) + karamba.redrawWidget(widget) + return - karamba.managementPopup(widget) - + karamba.managementPopup(widget) + # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/disableRightClickMenu/disable_menu.py b/superkaramba/examples/disableRightClickMenu/disable_menu.py index 6c524dd..e903d26 100644 --- a/superkaramba/examples/disableRightClickMenu/disable_menu.py +++ b/superkaramba/examples/disableRightClickMenu/disable_menu.py @@ -45,7 +45,7 @@ def widgetClicked(widget, x, y, button): if text2: karamba.deleteText(widget,text2) text2 = karamba.createText(widget,5,70,400,20,newText) - print newText + print(newText) elif not clicked and button == 1: clicked = True karamba.setWantRightButton(widget, True) @@ -53,9 +53,9 @@ def widgetClicked(widget, x, y, button): if text2: karamba.deleteText(widget,text2) text2 = karamba.createText(widget,5,70,400,20,newText) - print newText + print(newText) if button == 3: - print "Clicking the right mouse button is recognized now." + print("Clicking the right mouse button is recognized now.") karamba.redrawWidget(widget) #This gets called everytime our widget is clicked. @@ -173,4 +173,4 @@ def keyPressed(widget, meter, char): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/globalMouse/extension/setup.py b/superkaramba/examples/globalMouse/extension/setup.py index f33f8a6..49bd87b 100644 --- a/superkaramba/examples/globalMouse/extension/setup.py +++ b/superkaramba/examples/globalMouse/extension/setup.py @@ -1,12 +1,14 @@ from distutils.core import setup, Extension -module1 = Extension('xcursor', - include_dirs = ['/usr/X11R6/include'], - libraries = ['X11'], - library_dirs = ['/usr/X11R6/lib'], - sources = ['xcursor.c']) +def main(): + setup(name = 'XMouseCursor', + version = '1.0', + description = 'Determines the position of the X mouse cursor', + ext_modules = [Extension('xcursor', + include_dirs = ['/usr/X11R6/include'], + libraries = ['X11'], + library_dirs = ['/usr/X11R6/lib'], + sources = ['xcursor.c'])]) -setup (name = 'XMouseCursor', - version = '1.0', - description = 'Determines the position of the X mouse cursor', - ext_modules = [module1]) +if __name__ == "__main__": + main() diff --git a/superkaramba/examples/globalMouse/extension/xcursor.c b/superkaramba/examples/globalMouse/extension/xcursor.c index 8dad240..fbe80fa 100644 --- a/superkaramba/examples/globalMouse/extension/xcursor.c +++ b/superkaramba/examples/globalMouse/extension/xcursor.c @@ -26,6 +26,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ +#define PY_SSIZE_T_CLEAN #include #include @@ -96,9 +97,16 @@ static PyMethodDef xcursorMethods[] = {NULL, NULL, 0, NULL} /* Sentinel */ }; -void initxcursor(void) +static struct PyModuleDef xcursordef = { - (void) Py_InitModule("xcursor", xcursorMethods); -} - + PyModuleDef_HEAD_INIT, + "xcursor", + NULL, + -1, + xcursorMethods +}; +PyMODINIT_FUNC PyInit_xcursor(void) +{ + return PyModule_Create(&xcursordef); +} diff --git a/superkaramba/examples/globalMouse/eyes.py b/superkaramba/examples/globalMouse/eyes.py index b95f86d..f6f3804 100644 --- a/superkaramba/examples/globalMouse/eyes.py +++ b/superkaramba/examples/globalMouse/eyes.py @@ -38,117 +38,122 @@ lp_width, lp_height = 11, 17 rp_width, rp_height = 11, 17 def pupille(mouse_x, mouse_y, eye_center_x, eye_center_y, eye_a, eye_b, widget_x, widget_y): - x = mouse_x - eye_center_x - widget_x - y = mouse_y - eye_center_y - widget_y - #print x, y + x = mouse_x - eye_center_x - widget_x + y = mouse_y - eye_center_y - widget_y + #print(x, y) - r = math.sqrt(x * x + y * y) - phi = math.atan2(y, x) - #print phi * math.pi + r = math.sqrt(x * x + y * y) + phi = math.atan2(y, x) + #print(phi * math.pi) - eye_x = eye_a * math.cos(phi) - eye_y = eye_b * math.sin(phi) - - eye_r = math.sqrt(eye_x * eye_x + eye_y * eye_y) + eye_x = eye_a * math.cos(phi) + eye_y = eye_b * math.sin(phi) + + eye_r = math.sqrt(eye_x * eye_x + eye_y * eye_y) - if eye_r < r: - return int(eye_x + eye_center_x), int(eye_y + eye_center_y) - - return int(x + eye_center_x), int(y + eye_center_y) + if eye_r < r: + return int(eye_x + eye_center_x), int(eye_y + eye_center_y) + + return int(x + eye_center_x), int(y + eye_center_y) - + #this is called when you widget is initialized def initWidget(widget): - pass + global init + global linkePupille + global rechtePupille + init = 0 + linkePupille = "" + rechtePupille = "" #this is called everytime your widget is updated #the update inverval is specified in the .theme file def widgetUpdated(widget): - global init - global linkePupille - global rechtePupille - - global w_width - global w_height + global init + global linkePupille + global rechtePupille + + global w_width + global w_height - global w_x - global w_y + global w_x + global w_y - global lx - global ly - global la - global lb + global lx + global ly + global la + global lb - global lp_width - global lp_height + global lp_width + global lp_height - global rx - global ry - global ra - global rb + global rx + global ry + global ra + global rb - global rp_width - global rp_height + global rp_width + global rp_height - global x_old - global y_old + global x_old + global y_old - if init == 0: - theme_path = karamba.getThemePath(widget) + "/" - - # read widget coordinates from eyes.theme - # f = open(theme_path + "eyes.theme") + if init == 0: + theme_path = karamba.getThemePath(widget) + "/" + + # read widget coordinates from eyes.theme + # f = open(theme_path + "eyes.theme") - # karamba_line = "" - #while re.compile('KARAMBA').search(karamba_line) == None: - # karamba_line = f.readline() + # karamba_line = "" + #while re.compile('KARAMBA').search(karamba_line) == None: + # karamba_line = f.readline() - #w_x = int(re.compile('X=([0-9]+)').search(karamba_line).group(1)) - #w_y = int(re.compile('Y=([0-9]+)').search(karamba_line).group(1)) + #w_x = int(re.compile('X=([0-9]+)').search(karamba_line).group(1)) + #w_y = int(re.compile('Y=([0-9]+)').search(karamba_line).group(1)) - #f.close() + #f.close() - #karamba.createWidgetMask(widget, theme_path + "pics/mask.png") + #karamba.createWidgetMask(widget, theme_path + "pics/mask.png") - linkePupille = karamba.createImage(widget, 15, 30, theme_path + "pics/pupille.png") - rechtePupille = karamba.createImage(widget, 100, 30, theme_path + "pics/pupille.png") - init = 1 + linkePupille = karamba.createImage(widget, 15, 30, theme_path + "pics/pupille.png") + rechtePupille = karamba.createImage(widget, 100, 30, theme_path + "pics/pupille.png") + init = 1 - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) - # query mouse-cursor position - x, y = xcursor.position() - - #fp = os.popen("./xpos") - #output = fp.read() - #x, y = output.split() - - #print x, y + # query mouse-cursor position + x, y = xcursor.position() + + #fp = os.popen("./xpos") + #output = fp.read() + #x, y = output.split() + + #print(x, y) - if x != x_old or y != y_old: - x_old, y_old = x, y - # Get Widget Position - w_x, w_y = karamba.getWidgetPosition(widget) + if x != x_old or y != y_old: + x_old, y_old = x, y + # Get Widget Position + w_x, w_y = karamba.getWidgetPosition(widget) - # Calc left pupille - xp, yp = pupille (int(x), int(y), lx, ly, la, lb, w_x, w_y) + # Calc left pupille + xp, yp = pupille (int(x), int(y), lx, ly, la, lb, w_x, w_y) - xp = xp - lp_width / 2 - yp = yp - lp_height / 2 - #print xp, yp + xp = xp - lp_width // 2 + yp = yp - lp_height // 2 + #print(xp, yp) - karamba.moveImage(widget, linkePupille, xp, yp) + karamba.moveImage(widget, linkePupille, xp, yp) - # Calc right pupille - xp, yp = pupille (int(x), int(y), rx, ry, ra, rb, w_x, w_y) + # Calc right pupille + xp, yp = pupille (int(x), int(y), rx, ry, ra, rb, w_x, w_y) - xp = xp - rp_width / 2 - yp = yp - rp_height / 2 - #print xp, yp + xp = xp - rp_width // 2 + yp = yp - rp_height // 2 + #print(xp, yp) - karamba.moveImage(widget, rechtePupille, xp, yp) + karamba.moveImage(widget, rechtePupille, xp, yp) - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) #This gets called everytime our widget is clicked. #Notes: @@ -180,13 +185,13 @@ def widgetClicked(widget, x, y, button): def widgetMouseMoved(widget, x, y, button): #Warning: Don't do anything too intensive here #You don't want to run some complex piece of code everytime the mouse moves - pass - #global linkePupille + pass + #global linkePupille - #karamba.moveImage(widget, linkePupille, x, y) - #karamba.redrawWidget(widget) + #karamba.moveImage(widget, linkePupille, x, y) + #karamba.redrawWidget(widget) # This will be printed when the widget loads. -print "Loaded Karamba Eyes" +print("Loaded Karamba Eyes") diff --git a/superkaramba/examples/globalMouse/xcursor.so b/superkaramba/examples/globalMouse/xcursor.so old mode 100644 new mode 100755 index 1ff08d5..167bb29 Binary files a/superkaramba/examples/globalMouse/xcursor.so and b/superkaramba/examples/globalMouse/xcursor.so differ 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!") diff --git a/superkaramba/examples/image/image.py b/superkaramba/examples/image/image.py index 97656eb..54f2106 100644 --- a/superkaramba/examples/image/image.py +++ b/superkaramba/examples/image/image.py @@ -44,22 +44,22 @@ def widgetUpdated(widget): # size & resize size = karamba.getImageSize(widget, images[1]) - print "getImageSize: " + str(size) - print "getImageWidth: " + str(karamba.getImageWidth(widget, images[1])) - print "getImageHeight: " + str(karamba.getImageHeight(widget, images[1])) + print("getImageSize: " + str(size)) + print("getImageWidth: " + str(karamba.getImageWidth(widget, images[1]))) + print("getImageHeight: " + str(karamba.getImageHeight(widget, images[1]))) # Auto size #size = ((b * 200) + 200, size[1]) #karamba.resizeImage(widget, images[1], size[0], size[1]) # pos & move pos = karamba.getImagePos(widget, images[2]) - print "getImagePos: " + str(pos) + print("getImagePos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveImage(widget, images[2], pos[0], pos[1]) # Sensor sensor = karamba.getImageSensor(widget, images[3]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setImageSensor(widget, images[3], 'SENSOR=PROGRAM PROGRAM="/tmp/test1.sh"') else: @@ -67,7 +67,7 @@ def widgetUpdated(widget): # Value v = karamba.getImagePath(widget, images[4]) - print "getImagePath: ", v + print("getImagePath: ", v) if(b): v = 'flag.png' else: @@ -118,4 +118,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Image test python extension!" +print("Loaded Image test python extension!") diff --git a/superkaramba/examples/input_api/input_api.py b/superkaramba/examples/input_api/input_api.py index 59dc9ba..0a9725f 100644 --- a/superkaramba/examples/input_api/input_api.py +++ b/superkaramba/examples/input_api/input_api.py @@ -182,4 +182,4 @@ def keyPressed(widget, meter, char): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/input_example/input_example.py b/superkaramba/examples/input_example/input_example.py index c0145c9..62a369f 100644 --- a/superkaramba/examples/input_example/input_example.py +++ b/superkaramba/examples/input_example/input_example.py @@ -153,7 +153,7 @@ def wallpaperChanged(widget, desktop): def keyPressed(widget, meter, char): global input, output if meter == input: - print "keyPressed: key= '", char, "'" + print("keyPressed: key= '", char, "'") text = karamba.getInputBoxValue(widget, input) karamba.changeText(widget, output, "Searched: " + text) try: @@ -161,9 +161,9 @@ def keyPressed(widget, meter, char): url = "konqueror leo:" + text os.system(url + "&") except TypeError: - print "There was a type error" + print("There was a type error") karamba.redrawWidget(widget) # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/mouseDrag/karmix/karmix.py b/superkaramba/examples/mouseDrag/karmix/karmix.py index 225eefb..bd167db 100644 --- a/superkaramba/examples/mouseDrag/karmix/karmix.py +++ b/superkaramba/examples/mouseDrag/karmix/karmix.py @@ -186,5 +186,5 @@ def activeTaskChanged(widget, task): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/mouseDrop/mousedrop.py b/superkaramba/examples/mouseDrop/mousedrop.py index 521f0ee..b83c1df 100644 --- a/superkaramba/examples/mouseDrop/mousedrop.py +++ b/superkaramba/examples/mouseDrop/mousedrop.py @@ -134,5 +134,5 @@ def activeTaskChanged(widget, task): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/popupMenu/popupMenu.py b/superkaramba/examples/popupMenu/popupMenu.py index 8df5aef..39010f7 100644 --- a/superkaramba/examples/popupMenu/popupMenu.py +++ b/superkaramba/examples/popupMenu/popupMenu.py @@ -20,21 +20,21 @@ def initWidget(widget): global id5 menu1 = karamba.createMenu(widget) - print "menu 1 created!" + print("menu 1 created!") menu2 = karamba.createMenu(widget) - print "menu 2 created!" + print("menu 2 created!") id1 = karamba.addMenuItem(widget, menu1, "menu 1 first item", "kword") - print "item 1 entered in menu 1" + print("item 1 entered in menu 1") id2 = karamba.addMenuItem(widget, menu1, "menu 1 second item", "kate") - print "item 2 entered in menu 1" + print("item 2 entered in menu 1") id3 = karamba.addMenuItem(widget, menu2, "menu 2 first item", "kword") - print "item 1 entered in menu 2" + print("item 1 entered in menu 2") id4 = karamba.addMenuItem(widget, menu2, "menu 2 second item", "kate") - print "item 2 entered in menu 2" + print("item 2 entered in menu 2") id5 = karamba.addMenuItem(widget, menu2, "menu 2 third item", "/opt/kde/share/icons/kdeclassic/16x16/apps/kicker.png") - print "item 3 entered in menu 2" + print("item 3 entered in menu 2") @@ -95,23 +95,23 @@ def menuItemClicked(widget, menu, id): if (menu == menu1): if(id == id1): - print "item 1 in menu 1 clicked." + print("item 1 in menu 1 clicked.") elif(id == id2): - print "item 2 in menu 1 clicked, removing item 2 in menu 2" + print("item 2 in menu 1 clicked, removing item 2 in menu 2") karamba.removeMenuItem(widget, menu2, id4) elif (menu == menu2): if(id == id3): - print "item 1 in menu 2 clicked." + print("item 1 in menu 2 clicked.") elif(id == id4): - print "item 2 in menu 2 clicked, deleting menu 1 (if menu1 still exists...)" + print("item 2 in menu 2 clicked, deleting menu 1 (if menu1 still exists...)") karamba.deleteMenu(widget, menu1) elif(id == id5): - print "item 3 in menu 2 clicked, removing item 2 in menu 1 (if menu1 still exists...)" + print("item 3 in menu 2 clicked, removing item 2 in menu 1 (if menu1 still exists...)") karamba.removeMenuItem(widget, menu1, id2) # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/richtext/richtext.py b/superkaramba/examples/richtext/richtext.py index 518aa65..6da4080 100644 --- a/superkaramba/examples/richtext/richtext.py +++ b/superkaramba/examples/richtext/richtext.py @@ -30,7 +30,7 @@ is used to encode the formatting commands.

Some features: