Description: Port tools/dbusmenu-bench from Py2 to Py3.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/tools/dbusmenu-bench
+++ b/tools/dbusmenu-bench
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # encoding: utf-8
 """
 A library to communicate a menu object set accross DBus and
@@ -60,8 +60,8 @@
 
 
 def dump_properties(properties, prepend=""):
-    for key, value in properties.items():
-        print "%s- %s: %s" % (prepend, key, value)
+    for key, value in list(properties.items()):
+        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,27 +89,27 @@
     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
 
 def create_timing_dict():
-    return dict(zip(PROBES, itertools.repeat(0)))
+    return dict(list(zip(PROBES, itertools.repeat(0))))
 
 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]")
@@ -134,7 +134,7 @@
     max_timings = create_timing_dict()
     for x in range(options.count):
         timings = run_test_sequence(menu)
-        for name, timing in timings.items():
+        for name, timing in list(timings.items()):
             cumulated_timings[name] += timing
             if min_timings[name] == 0 or min_timings[name] > timing:
                 min_timings[name] = timing
@@ -142,11 +142,11 @@
                 max_timings[name] = timing
 
     timestamp = int(time.time())
-    for name, timing in cumulated_timings.items():
+    for name, timing in list(cumulated_timings.items()):
         print_probe("average", name, timing / options.count, timestamp)
-    for name, timing in min_timings.items():
+    for name, timing in list(min_timings.items()):
         print_probe("min", name, timing, timestamp)
-    for name, timing in max_timings.items():
+    for name, timing in list(max_timings.items()):
         print_probe("max", name, timing, timestamp)
 
     return 0
