Bug 1110 - Sort alphabetically and display "Modules built" in columns
Sort alphabetically and display "Modules built" in columns
Product: ns-3
Classification: Unclassified
Component: general
All All
: P5 enhancement
Assigned To: ns-bugs
Depends on:
  Show dependency treegraph
Reported: 2011-04-22 16:09 EDT by John Abraham
Modified: 2011-04-26 17:30 EDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description John Abraham 2011-04-22 16:09:51 EDT
As the number of modules in ns-3 will increase we could have 

Modules built:
aodv                      applications              bridge                   
click                     config-store              core                     
csma                      dsdv                      emu                      
energy                    flow-monitor              internet                 
lte                       mesh                      mobility                 
mpi                       netanim                   network                  
nix-vector-routing        ns3tcp                    ns3wifi                  
olsr                      openflow                  point-to-point           
propagation               spectrum                  stats                    
tap-bridge                test                      tools                    
topology-read             uan                       virtual-net-device       
visualizer                wifi                      wimax    

instead of 

Modules built:
core, network, config-store, internet, propagation, point-to-point, csma, emu, bridge, tap-bridge, virtual-net-device, applications, nix-vector-routing, olsr, aodv, dsdv, click, openflow, mobility, wifi, netanim, stats, uan, spectrum, mesh, test, ns3tcp, ns3wifi, flow-monitor, wimax, lte, mpi, topology-read, energy, tools, visualizer

I will leave it to the python experts to do this correctly. But this is how I did it

    modules_without_prefix =[mod[len('ns3-'):] for mod in env['NS3_ENABLED_MODULES']]
    modules_without_prefix = sorted(modules_without_prefix)
    print 'Modules built:'
    i = 1
    for mod in modules_without_prefix:

        print mod.ljust(25),
        if i == 3:
                i = 0
        i = i+1
Comment 1 Mitch Watrous 2011-04-26 17:28:11 EDT
I made the list alphabetical but wrapped the lines at 70 characters rather than making columns:

Modules built:
aodv, applications, bridge, click, config-store, core, csma, dsdv,
emu, energy, flow-monitor, internet, lte, mesh, mobility, mpi,
netanim, network, nix-vector-routing, ns3tcp, ns3wifi, olsr, openflow,
point-to-point, propagation, spectrum, stats, tap-bridge, test, tools,
topology-read, uan, virtual-net-device, visualizer, wifi, wimax