a first very rough step towards python3
[nepi.git] / src / nepi / data / processing / ccn / parser.py
index 7d35d9e..582b8dd 100644 (file)
@@ -40,7 +40,7 @@
 #                        \ nid3.log
 #
 
-from __future__ import print_function
+
 
 import collections
 import functools
@@ -242,7 +242,7 @@ def annotate_cn_graph(logs_dir, graph, parse_ping_logs = False):
 
     if not found_files:
         msg = "No CCND output files were found to parse at %s " % logs_dir
-        raise RuntimeError, msg
+        raise RuntimeError(msg)
 
     if parse_ping_logs:
         ping_parser.annotate_cn_graph(logs_dir, graph)
@@ -281,7 +281,7 @@ def process_content_history(graph):
         fname = graph.node[nid]["history"]
         history = load_content_history(fname)
 
-        for content_name in history.keys():
+        for content_name in list(history.keys()):
             hist = history[content_name]
 
             for (timestamp, message_type, nid1, nid2, nonce, size, line) in hist:
@@ -334,13 +334,13 @@ def process_content_history(graph):
 
     # Compute the time elapsed between the time an interest is sent
     # in the consumer node and when the content is received back
-    for content_name in content_names.keys():
+    for content_name in list(content_names.keys()):
         # order content and interest messages by timestamp
         content_names[content_name]["content"] = sorted(
               content_names[content_name]["content"])
         
         for nonce, timestamps in content_names[content_name][
-                    "interest"].iteritems():
+                    "interest"].items():
               content_names[content_name]["interest"][nonce] = sorted(
                         timestamps)