summaryrefslogtreecommitdiffstats
path: root/superkaramba/examples/service_group/service_group.py
diff options
context:
space:
mode:
Diffstat (limited to 'superkaramba/examples/service_group/service_group.py')
-rw-r--r--superkaramba/examples/service_group/service_group.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/superkaramba/examples/service_group/service_group.py b/superkaramba/examples/service_group/service_group.py
index 276b9c8..a56835e 100644
--- a/superkaramba/examples/service_group/service_group.py
+++ b/superkaramba/examples/service_group/service_group.py
@@ -16,23 +16,25 @@ import karamba
# simple function to display
def create_text(widget, line, depth, disp, name=None, command=None, icon=None):
+ print(name)
+ print(disp)
x = depth*30
- y = line*7
+ y = line*12
width = 400
- height = 8
+ height = 12
drop_txt = karamba.createText(widget, x, y, width, height, disp)
- karamba.changeTextSize(widget, drop_txt, 7)
+ karamba.changeTextSize(widget, drop_txt, 11)
karamba.changeTextColor(widget, drop_txt, 252,252,252)
- # create a (very narrow! only an 8-pixel-high area!)
+ # create a (very narrow! only an 12-pixel-high area!)
# service click area to demonstrate that commands get
# executed correctly.
if name:
karamba.createServiceClickArea( widget,
x,y,width,height,
- name, command, icon)
+ str(name), str(command), str(icon))
# okay. you really should be looking up the KDE Developer documentation
@@ -92,14 +94,14 @@ def display_svc_group(widget, rel_path, line, depth):
for (type, d) in grps:
- if type is 0:
+ if type == 0:
# it's a
- sub_relpath = d['relpath']
- icon = d.get('icon', 'unknown')
- caption = d.get('caption', None)
- comment = d.get('comment', None)
+ sub_relpath = d[b'relpath'].decode('utf-8')
+ icon = d.get(b'icon', 'unknown').decode('utf-8')
+ caption = d.get(b'caption', b'').decode('utf-8')
+ comment = d.get(b'comment', b'').decode('utf-8')
cmt = ''
# get at least something to display
@@ -109,23 +111,24 @@ def display_svc_group(widget, rel_path, line, depth):
cmt = caption
msg = "SVCGRP: %s %s" % (icon, cmt)
+ print("MSG="+msg)
create_text(widget, line, depth, msg)
line += 1
- line = display_svc_group(widget, sub_relpath,
+ line = display_svc_group(widget, str(sub_relpath),
line, depth+1)
- elif type is 1 and d.has_key('menuid'):
+ elif type == 1 and b'menuid' in d:
- relpath = d.get('relpath', '')
- cmd = d['exec']
- icon = d.get('icon', 'unknown')
- name = d.get('name', None)
- genericname = d.get('genericname', None)
+ relpath = d.get(b'relpath', b'').decode('utf-8')
+ cmd = d[b'exec'].decode('utf-8')
+ icon = d.get(b'icon', 'unknown').decode('utf-8')
+ name = d.get(b'name', b'').decode('utf-8')
+ genericname = d.get(b'genericname', b'')
cmt = ''
# get at least something to display
if genericname:
- cmt = genericname
+ cmt = genericname.decode('utf-8')
elif name:
cmt = name