Bugzilla – Full Text Bug Listing |
Summary: | Error in Ascii tracing in Python examples | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Kim Højgaard-Hansen <kimrhh> |
Component: | examples | Assignee: | ns-bugs <ns-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jpelkey |
Priority: | P5 | ||
Version: | pre-release | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | fix ascii tracing in python example scripts |
oh i forgot to state: this bug is present in ns3-dev still. The patch is made with "hg diff" on a ns3-dev checkout I went ahead and submitted changes for these, but left them commented. If you would like to see tracing by default in all python examples, please file a p5 enh bug. Thanks! changeset: a02c44146209 |
Created attachment 836 [details] fix ascii tracing in python example scripts The ascii tracing Python API seems to have changed after the example python scripts was made, and is currently broken. I guess the reason it has gone undetected so far is that it is commented out in the examples, hence not run when they are executed in their default versions. Commenting in the ascii tracing in csma-bridge.py and running it: kimrhh@exherbo-work-laptop ~/Downloads/ns-allinone-3.7.1/ns-3.7.1 $ ./waf --pyrun examples/csma/csma-bridge.py Waf: Entering directory `/home/kimrhh/Downloads/ns-allinone-3.7.1/ns-3.7.1/build' Waf: Leaving directory `/home/kimrhh/Downloads/ns-allinone-3.7.1/ns-3.7.1/build' 'build' finished successfully (1.340s) File "examples/csma/csma-bridge.py", line 126 std.ofstream ascii ^ SyntaxError: invalid syntax Command ['/usr/bin/python', 'examples/csma/csma-bridge.py'] exited with code 1 a patch to fix the two examples with the broken syntax is attached. another thing is, would it be an idea to add ascii tracing to all the examples, and have it running per default? then regressions would be caught easier and a user try one randomly chosen (usually that's how you start) python script would not have to search a lot to get ascii tracing going. Just a thought, maybe that should go i another bug ? :)