Skip to content

Commit

Permalink
format py
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoweifeng01 authored and zhangchaoltt committed Sep 26, 2019
1 parent 7a1f2f0 commit 1f5d323
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cyber/python/examples/record_channel_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from cyber_py import record
from cyber.proto import record_pb2


def print_channel_info(file_path):
freader = record.RecordReader(file_path)
channels = freader.get_channellist()
Expand All @@ -32,7 +33,9 @@ def print_channel_info(file_path):

print('\n++++++++++++Begin Channel Info Statistics++++++++++++++')
print('-' * 40)
print('record version: [%d:%d]' % (header.major_version, header.minor_version))
print(
'record version: [%d:%d]' %
(header.major_version, header.minor_version))
print('record message_number: %s' % str(header.message_number))
print('record file size(Byte): %s' % str(header.size))
print('chunk_number: %d' % header.chunk_number)
Expand All @@ -42,7 +45,9 @@ def print_channel_info(file_path):
for channel in channels:
desc = freader.get_protodesc(channel)
count += 1
print('Channel: %s, count: %d, desc size: %d' % (channel, count, len(desc)))
print(
'Channel: %s, count: %d, desc size: %d' %
(channel, count, len(desc)))
# print desc
print "++++++++++++Finish Channel Info Statistics++++++++++++++\n"

Expand Down
2 changes: 2 additions & 0 deletions cyber/python/test/test_cyber_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
global count
count = 0


def func():
global count
print('Callback function is called [%d] times.' % count)
count += 1


class TestNode(unittest.TestCase):

"""
Class for node unit test.
"""
Expand Down
2 changes: 1 addition & 1 deletion cyber/python/test/test_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

PARAM_SERVICE_NAME = "global_parameter_service"


class TestParams(unittest.TestCase):

"""
Expand All @@ -38,7 +39,6 @@ def setUpClass(cls):
def tearDownClass(cls):
cyber.shutdown()


def test_params(self):
param1 = parameter.Parameter("author_name", "WanderingEarth")
param2 = parameter.Parameter("author_age", 5000)
Expand Down

0 comments on commit 1f5d323

Please sign in to comment.