From 6858d16f5758961a7985633cb2d85bfca1bd2819 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Tue, 22 Mar 2011 17:27:25 +0000 Subject: [PATCH] Modular bindings: fix 'import_from_module' with module names with dashes --- bindings/python/ns3modulescan-modular.py | 2 +- src/netanim/bindings/modulegen__gcc_ILP32.py | 2 +- src/netanim/bindings/modulegen__gcc_LP64.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/ns3modulescan-modular.py b/bindings/python/ns3modulescan-modular.py index 5ef88452f..6fbeb5733 100644 --- a/bindings/python/ns3modulescan-modular.py +++ b/bindings/python/ns3modulescan-modular.py @@ -141,7 +141,7 @@ class PreScanHook: if definition_module != self.module: - global_annotations['import_from_module'] = 'ns.%s' % definition_module + global_annotations['import_from_module'] = 'ns.%s' % (definition_module.replace('-', '_'),) if pygccxml_definition.decl_string.startswith('::ns3::SimpleRefCount<'): global_annotations['incref_method'] = 'Ref' diff --git a/src/netanim/bindings/modulegen__gcc_ILP32.py b/src/netanim/bindings/modulegen__gcc_ILP32.py index 1e7d3b82d..b12101069 100644 --- a/src/netanim/bindings/modulegen__gcc_ILP32.py +++ b/src/netanim/bindings/modulegen__gcc_ILP32.py @@ -131,7 +131,7 @@ def register_types(module): ## point-to-point-grid-helper.h (module 'netanim'): ns3::PointToPointGridHelper [class] module.add_class('PointToPointGridHelper') ## point-to-point-helper.h (module 'point-to-point'): ns3::PointToPointHelper [class] - module.add_class('PointToPointHelper', import_from_module='ns.point-to-point', parent=[root_module['ns3::PcapHelperForDevice'], root_module['ns3::AsciiTraceHelperForDevice']]) + module.add_class('PointToPointHelper', import_from_module='ns.point_to_point', parent=[root_module['ns3::PcapHelperForDevice'], root_module['ns3::AsciiTraceHelperForDevice']]) ## point-to-point-star-helper.h (module 'netanim'): ns3::PointToPointStarHelper [class] module.add_class('PointToPointStarHelper') ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount [class] diff --git a/src/netanim/bindings/modulegen__gcc_LP64.py b/src/netanim/bindings/modulegen__gcc_LP64.py index 1e7d3b82d..b12101069 100644 --- a/src/netanim/bindings/modulegen__gcc_LP64.py +++ b/src/netanim/bindings/modulegen__gcc_LP64.py @@ -131,7 +131,7 @@ def register_types(module): ## point-to-point-grid-helper.h (module 'netanim'): ns3::PointToPointGridHelper [class] module.add_class('PointToPointGridHelper') ## point-to-point-helper.h (module 'point-to-point'): ns3::PointToPointHelper [class] - module.add_class('PointToPointHelper', import_from_module='ns.point-to-point', parent=[root_module['ns3::PcapHelperForDevice'], root_module['ns3::AsciiTraceHelperForDevice']]) + module.add_class('PointToPointHelper', import_from_module='ns.point_to_point', parent=[root_module['ns3::PcapHelperForDevice'], root_module['ns3::AsciiTraceHelperForDevice']]) ## point-to-point-star-helper.h (module 'netanim'): ns3::PointToPointStarHelper [class] module.add_class('PointToPointStarHelper') ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount [class]