still making both branches closer
[nepi.git] / src / nepi / resources / ns3 / resource_manager_generator.py
index de73775..6bd9b89 100644 (file)
@@ -96,7 +96,7 @@ def create_ns3_rms():
     base = type_id.LookupByName("ns3::Object")
 
     # Create a .py file using the ns-3 RM template for each ns-3 TypeId
-    for i in xrange(tid_count):
+    for i in range(tid_count):
         tid = type_id.GetRegistered(i)
         
         (base_class_import, base_class) = select_base_class(ns3, tid)
@@ -156,7 +156,7 @@ def template_attributes(ns3, tid):
     attributes = ""
 
     attr_count = tid.GetAttributeN()
-    for i in xrange(attr_count):
+    for i in range(attr_count):
         attr_info = tid.GetAttribute(i)
         if not attr_info.accessor.HasGetter():
             continue
@@ -192,7 +192,7 @@ def template_attributes(ns3, tid):
         elif isinstance(value, ns3.EnumValue):
             attr_type = "Types.Enumerate"
             allowed = checker.GetUnderlyingTypeInformation().split("|")
-            attr_allowed = "[%s]" % ",".join(map(lambda x: "\"%s\"" % x, allowed))
+            attr_allowed = "[%s]" % ",".join(["\"%s\"" % x for x in allowed])
         elif isinstance(value, ns3.DoubleValue):
             attr_type = "Types.Double"
             # TODO: range
@@ -220,7 +220,7 @@ def template_traces(ns3, tid):
     traces = ""
 
     trace_count = tid.GetTraceSourceN()
-    for i in xrange(trace_count):
+    for i in range(trace_count):
         trace_info = tid.GetTraceSource(i)
         trace_name = trace_info.name
         trace_help = trace_info.help.replace('"', '\\"').replace("'", "\\'")