From 1f5d323863134762bc4ce02d33158d3b77588815 Mon Sep 17 00:00:00 2001 From: yaoweifeng01 Date: Thu, 26 Sep 2019 16:39:25 +0800 Subject: [PATCH] format py --- cyber/python/examples/record_channel_info.py | 9 +++++++-- cyber/python/test/test_cyber_timer.py | 2 ++ cyber/python/test/test_parameter.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cyber/python/examples/record_channel_info.py b/cyber/python/examples/record_channel_info.py index 78e7ef33c8e..04069a1d085 100644 --- a/cyber/python/examples/record_channel_info.py +++ b/cyber/python/examples/record_channel_info.py @@ -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() @@ -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) @@ -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" diff --git a/cyber/python/test/test_cyber_timer.py b/cyber/python/test/test_cyber_timer.py index 58ca45704e1..0ed60b6c3db 100644 --- a/cyber/python/test/test_cyber_timer.py +++ b/cyber/python/test/test_cyber_timer.py @@ -25,6 +25,7 @@ global count count = 0 + def func(): global count print('Callback function is called [%d] times.' % count) @@ -32,6 +33,7 @@ def func(): class TestNode(unittest.TestCase): + """ Class for node unit test. """ diff --git a/cyber/python/test/test_parameter.py b/cyber/python/test/test_parameter.py index 7486fe53bd5..f4d7a4c5443 100644 --- a/cyber/python/test/test_parameter.py +++ b/cyber/python/test/test_parameter.py @@ -25,6 +25,7 @@ PARAM_SERVICE_NAME = "global_parameter_service" + class TestParams(unittest.TestCase): """ @@ -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)