Skip to content

Commit

Permalink
PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Diamond committed Jan 10, 2024
1 parent 9ef7ecf commit 146552c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/examples/udp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
""")

parser.add_argument('-f', '--format', default='p1log', choices=('p1log', 'raw', 'csv'),
help="The format of the file to be generated when --output is enabled."
"If 'p1log' (default), create a *.p1log file containing only FusionEngine messages."
"If 'raw', create a generic binary file containing all incoming data."
"If 'csv', create a csv of time vs message type.")
help="""\
The format of the file to be generated when --output is enabled:
- p1log - (default), create a *.p1log file containing only FusionEngine messages."
- raw - create a generic binary file containing all incoming data."
- csv - create a csv of time vs message type.""")
parser.add_argument('-n', '--no-display', dest='display', action='store_false',
help="Do not display the incoming message contents.")
parser.add_argument('-o', '--output', type=str,
Expand Down Expand Up @@ -81,7 +82,7 @@
if not options.quiet:
now = datetime.now()
if (now - last_print_time).total_seconds() > 5.0:
print('Status: [bytes_received=%d, messages_received=%d elapsed_time=%d sec]' %
print('Status: [bytes_received=%d, messages_received=%d, elapsed_time=%d sec]' %
(bytes_received, messages_received, (now - start_time).total_seconds()))
last_print_time = now
except KeyboardInterrupt:
Expand Down Expand Up @@ -127,5 +128,5 @@
if not options.quiet:
now = datetime.now()
elapsed_sec = (now - last_print_time).total_seconds() if last_print_time else 0.0
print('Status: [bytes_received=%d, messages_received=%d elapsed_time=%d sec]' %
print('Status: [bytes_received=%d, messages_received=%d, elapsed_time=%d sec]' %
(bytes_received, messages_received, elapsed_sec))

0 comments on commit 146552c

Please sign in to comment.