Add function docstring

This commit is contained in:
Christophe Bedard 2019-06-24 10:53:27 +02:00
parent d5767dc11a
commit 578ef3bd02
2 changed files with 18 additions and 1 deletions

View file

@ -25,6 +25,11 @@ def add_trace_arguments(parser):
def init(args):
"""
Init and start tracing.
:param args: the parsed arguments object containing the right fields
"""
session_name = args.session_name
base_path = args.path
full_path = os.path.join(base_path, session_name)
@ -52,6 +57,11 @@ def init(args):
def fini(args):
"""
Stop and finalize tracing.
:param args: the parsed arguments object containing the right fields
"""
session_name = args.session_name
input('press enter to stop...')
print('stopping & destroying tracing session')

View file

@ -42,7 +42,14 @@ class Trace(Action):
events_kernel: List[str] = names.DEFAULT_EVENTS_KERNEL,
**kwargs,
) -> None:
"""Constructor."""
"""
Constructor.
:param session_name: the name of the tracing session
:param base_path: the base directory in which to create the trace directory
:param events_ust: the list of ROS UST events to enable
:param events_kernel: the list of kernel events to enable
"""
super().__init__(**kwargs)
self.__session_name = session_name
self.__path = os.path.join(base_path, session_name)