Fix lint and formatting errors

This commit is contained in:
Christophe Bedard 2019-06-24 16:13:42 +02:00
parent de8c131a34
commit 82d2d26f9a
7 changed files with 32 additions and 17 deletions

View file

@ -16,8 +16,8 @@
from ros2cli.command import CommandExtension from ros2cli.command import CommandExtension
from ros2trace.api import add_trace_arguments from ros2trace.api import add_trace_arguments
from ros2trace.api import init
from ros2trace.api import fini from ros2trace.api import fini
from ros2trace.api import init
class TraceCommand(CommandExtension): class TraceCommand(CommandExtension):

View file

@ -7,8 +7,14 @@ setup(
packages=find_packages(exclude=['test']), packages=find_packages(exclude=['test']),
install_requires=['ros2cli'], install_requires=['ros2cli'],
zip_safe=True, zip_safe=True,
maintainer='Christophe Bedard, Ingo Lütkebohle', maintainer=(
maintainer_email='fixed-term.christophe.bourquebedard@de.bosch.com, ingo.luetkebohle@de.bosch.com', 'Christophe Bedard, '
'Ingo Lütkebohle'
),
maintainer_email=(
'fixed-term.christophe.bourquebedard@de.bosch.com, '
'ingo.luetkebohle@de.bosch.com'
),
author='Christophe Bedard', author='Christophe Bedard',
author_email='fixed-term.christophe.bourquebedard@de.bosch.com', author_email='fixed-term.christophe.bourquebedard@de.bosch.com',
# url=', # url=',

View file

@ -14,8 +14,14 @@ setup(
('share/' + package_name + '/launch', glob.glob('launch/*.launch.py')), ('share/' + package_name + '/launch', glob.glob('launch/*.launch.py')),
], ],
install_requires=['setuptools'], install_requires=['setuptools'],
maintainer='Christophe Bedard, Ingo Lütkebohle', maintainer=(
maintainer_email='fixed-term.christophe.bourquebedard@de.bosch.com, ingo.luetkebohle@de.bosch.com', 'Christophe Bedard, '
'Ingo Lütkebohle'
),
maintainer_email=(
'fixed-term.christophe.bourquebedard@de.bosch.com, '
'ingo.luetkebohle@de.bosch.com'
),
author='Christophe Bedard', author='Christophe Bedard',
author_email='fixed-term.christophe.bourquebedard@de.bosch.com', author_email='fixed-term.christophe.bourquebedard@de.bosch.com',
# url='', # url='',

View file

@ -11,8 +11,14 @@ setup(
('share/' + package_name, ['package.xml']), ('share/' + package_name, ['package.xml']),
], ],
install_requires=['setuptools'], install_requires=['setuptools'],
maintainer='Christophe Bedard, Ingo Lütkebohle', maintainer=(
maintainer_email='fixed-term.christophe.bourquebedard@de.bosch.com, ingo.luetkebohle@de.bosch.com', 'Christophe Bedard, '
'Ingo Lütkebohle'
),
maintainer_email=(
'fixed-term.christophe.bourquebedard@de.bosch.com, '
'ingo.luetkebohle@de.bosch.com'
),
author='Christophe Bedard', author='Christophe Bedard',
author_email='fixed-term.christophe.bourquebedard@de.bosch.com', author_email='fixed-term.christophe.bourquebedard@de.bosch.com',
# url='', # url='',

View file

@ -32,9 +32,7 @@ class DefaultArgValueCompleter:
def parse_args(): def parse_args():
""" """Parse args for tracing."""
Parse args for tracing.
"""
parser = argparse.ArgumentParser(description='Setup and launch an LTTng tracing session.') parser = argparse.ArgumentParser(description='Setup and launch an LTTng tracing session.')
add_arguments(parser) add_arguments(parser)
return parser.parse_args() return parser.parse_args()
@ -52,15 +50,15 @@ def add_arguments(parser):
arg = parser.add_argument( arg = parser.add_argument(
'--ust', '-u', nargs='*', dest='events_ust', default=names.DEFAULT_EVENTS_ROS, '--ust', '-u', nargs='*', dest='events_ust', default=names.DEFAULT_EVENTS_ROS,
help='the ROS UST events to enable (default: all events) ' help='the ROS UST events to enable (default: all events) '
'[to disable all UST events, ' '[to disable all UST events, '
'provide this flag without any event name]') 'provide this flag without any event name]')
arg.completer = DefaultArgValueCompleter(arg) arg.completer = DefaultArgValueCompleter(arg)
arg = parser.add_argument( arg = parser.add_argument(
'--kernel', '-k', nargs='*', dest='events_kernel', '--kernel', '-k', nargs='*', dest='events_kernel',
default=names.DEFAULT_EVENTS_KERNEL, default=names.DEFAULT_EVENTS_KERNEL,
help='the kernel events to enable (default: all events) ' help='the kernel events to enable (default: all events) '
'[to disable all UST events, ' '[to disable all UST events, '
'provide this flag without any event name]') 'provide this flag without any event name]')
arg.completer = DefaultArgValueCompleter(arg) arg.completer = DefaultArgValueCompleter(arg)
parser.add_argument( parser.add_argument(
'--list', '-l', dest='list', action='store_true', '--list', '-l', dest='list', action='store_true',

View file

@ -15,10 +15,10 @@
"""Interface for tracing with LTTng.""" """Interface for tracing with LTTng."""
import sys import sys
from typing import List
# Temporary workaround # Temporary workaround
sys.path = ['/usr/local/lib/python3.6/site-packages'] + sys.path sys.path = ['/usr/local/lib/python3.6/site-packages'] + sys.path
from typing import List
import lttng # noqa: E402 import lttng # noqa: E402
@ -206,7 +206,7 @@ def _create_session(session_name: str, full_path: str) -> None:
if result == -LTTNG_ERR_EXIST_SESS: if result == -LTTNG_ERR_EXIST_SESS:
# Sessions seem to persist, so if it already exists, # Sessions seem to persist, so if it already exists,
# just destroy it and try again # just destroy it and try again
lttng_destroy(session_name) _lttng_destroy(session_name)
result = lttng.create(session_name, full_path) result = lttng.create(session_name, full_path)
if result < 0: if result < 0:
raise RuntimeError(f'session creation failed: {lttng.strerror(result)}') raise RuntimeError(f'session creation failed: {lttng.strerror(result)}')

View file

@ -19,7 +19,6 @@ import os
from tracetools_trace.tools import args from tracetools_trace.tools import args
from tracetools_trace.tools import lttng from tracetools_trace.tools import lttng
from tracetools_trace.tools import names
def main(): def main():