File tree Expand file tree Collapse file tree
code/Examples/Python/HelloWorld
docs/fastdds/getting_started/simple_python_app/includes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ def on_data_available(self, reader):
4545 data = HelloWorld .HelloWorld ()
4646 reader .take_next_sample (data , info )
4747
48- print ("Received {message} : {index}" .format (message = data .message (), index = data .index ()))
48+ if info .valid_data :
49+ print ("Received {message} : {index}" .format (message = data .message (), index = data .index ()))
4950
5051
5152class Reader :
Original file line number Diff line number Diff line change @@ -45,25 +45,25 @@ The next line defines the :class:`Reader` class that implements a subscriber.
4545
4646.. literalinclude :: /../code/Examples/Python/HelloWorld/HelloWorldSubscriber.py
4747 :language: python
48- :lines: 51
48+ :lines: 52
4949
5050Next comes the subscriber initialization public member function.
5151This is the same as the initialization public member function defined for the :class: `Writer `.
5252
5353.. literalinclude :: /../code/Examples/Python/HelloWorld/HelloWorldSubscriber.py
5454 :language: python
55- :lines: 54-76
55+ :lines: 55-77
5656 :dedent: 4
5757
5858The public member function :func: `run ` ensures that the subscriber runs until the user press *Ctrl+C *.
5959
6060.. literalinclude :: /../code/Examples/Python/HelloWorld/HelloWorldSubscriber.py
6161 :language: python
62- :lines: 85-89
62+ :lines: 86-90
6363 :dedent: 4
6464
6565Finally, the participant that implements a subscriber is initialized and run in main.
6666
6767.. literalinclude :: /../code/Examples/Python/HelloWorld/HelloWorldSubscriber.py
6868 :language: python
69- :lines: 92-96
69+ :lines: 93-97
You can’t perform that action at this time.
0 commit comments