[Ns-developers] Status of Python bindings

Gustavo Carneiro gjcarneiro at gmail.com
Mon Jun 2 14:18:42 PDT 2008


On 02/06/2008, Gustavo Carneiro <gjcarneiro at gmail.com> wrote:
>
>
>
> On 19/05/2008, Gustavo Carneiro <gjcarneiro at gmail.com> wrote:
>>
>> The PyBindGen API changes are more or less complete:
>>
>> https://code.launchpad.net/~gjc/pybindgen/trunk<https://code.launchpad.net/%7Egjc/pybindgen/trunk>
>>
>> If nothing else comes up API-wise, next steps are:
>>
>>  1. Generate NS-3 API definitions as a single Python file and make it
>> work;
>>
>>  2. Split the above file into several files, and support local
>> modification files;
>
>
> Split is done.  Resulting files can be seen here, for example:
> http://code.nsnam.org/gjc/ns-3-pybindgen-notracing/file/4b7a3d82929f/bindings/python/
>
> Supporting local customizations is not yet done, but should be trivial to
> add.
>

Local customizations is done.  Let me explain how it is right now.

First, the generated files, through waf --python-scan, which uses gccxml
mode, are:

  1. The toplevel script ns3modulegen_generated.py;

  2. One ns3_module_xxx.py file per each module xxx;

The local customization files that are used, if found are:

  1. The script ns3modulegen.py[1] contains, at the top, a list of module
names to use for extra API definitions.  For example, [2];

  2. For each module xxx, a local module 'ns3_module_xxx__local' is imported
and, if found, the usual functions
register_types/register_methods/register_functions are called on it.


[1]
http://code.nsnam.org/gjc/ns-3-pybindgen-notracing/file/d4712a480820/bindings/python/ns3modulegen.py
[2]
http://code.nsnam.org/gjc/ns-3-pybindgen-notracing/file/d4712a480820/bindings/python/my_extra_api_definitions.py


 3. Figure out issues related to splitting python bindings into a separate
>> repository;
>>
>>  4. Document the process, adding examples;
>>
>>  5. Bring the code up to date to ns-3-dev (assuming it is API stable by
>> then).
>
>

-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list