Andreas Wacknitz
2023-11-23 5fb24290c063f553717c175d3086a832b2eb2679
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- libdbusmenu-16.04.0/tools/dbusmenu-bench.orig    2016-02-27 19:58:43.000000000 +0100
+++ libdbusmenu-16.04.0/tools/dbusmenu-bench    2023-11-23 20:17:44.777329961 +0100
@@ -61,7 +61,7 @@
 
 def dump_properties(properties, prepend=""):
     for key, value in properties.items():
-        print "%s- %s: %s" % (prepend, key, value)
+        print ("%s- %s: %s" % (prepend, key, value))
 
 
 def run_test_sequence(menu, dump=False):
@@ -74,9 +74,9 @@
     revision, layout = menu.GetLayout(dbus.Int32(0))
     times["GetLayout"] = chrono.elapsed()
     if dump:
-        print "revision:", revision
-        print "layout:"
-        print layout
+        print ("revision:", revision)
+        print ("layout:")
+        print (layout)
 
     # Get ids
     tree = ET.fromstring(layout)
@@ -89,17 +89,17 @@
     children = menu.GetChildren(dbus.Int32(root_id), property_names)
     times["GetChildren"] = chrono.elapsed()
     if dump:
-        print "children:"
+        print ("children:")
         for child in children:
             id, properties = child
-            print "- %d:" % id
+            print ("- %d:" % id)
             dump_properties(properties, prepend=" ")
 
     chrono.restart()
     properties = menu.GetProperties(dbus.Int32(child_id), property_names)
     times["GetProperties"] = chrono.elapsed()
     if dump:
-        print "properties:"
+        print ("properties:")
         dump_properties(properties)
 
     return times
@@ -109,7 +109,7 @@
 
 def print_probe(prefix, name, value, timestamp):
     value = int(value * 1000000)
-    print "%(prefix)s.%(name)s:%(value)d@%(timestamp)d" % locals()
+    print ("%(prefix)s.%(name)s:%(value)d@%(timestamp)d" % locals())
 
 def main():
     parser = OptionParser(usage = "%prog [options]")