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)
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
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
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("'", "\\'")