diff --git a/launch/launch/actions/execute_process.py b/launch/launch/actions/execute_process.py index c28a9752f..a568d7fc6 100644 --- a/launch/launch/actions/execute_process.py +++ b/launch/launch/actions/execute_process.py @@ -210,7 +210,7 @@ def __init__( :py:func:`evaluate_condition_expression`. Throws :py:exception:`InvalidConditionExpressionError` if the 'emulate_tty' configuration does not represent a boolean. - :param: prefix a set of commands/arguments to preceed the cmd, used for + :param: prefix a set of commands/arguments to precede the cmd, used for things like gdb/valgrind and defaults to the LaunchConfiguration called 'launch-prefix'. Note that a non-default prefix provided in a launch file will override the prefix provided via the `launch-prefix` @@ -264,7 +264,7 @@ def _append_arg(): if isinstance(sub, TextSubstitution): tokens = shlex.split(sub.text) if not tokens: - # Sting with just spaces. + # String with just spaces. # Appending args allow splitting two substitutions # separated by a space. # e.g.: `$(subst1 asd) $(subst2 bsd)` will be two separate arguments. diff --git a/launch/launch/descriptions/executable.py b/launch/launch/descriptions/executable.py index 109d1fc6d..a2d4d2ea9 100644 --- a/launch/launch/descriptions/executable.py +++ b/launch/launch/descriptions/executable.py @@ -59,7 +59,7 @@ def __init__( :param cmd: A list where the first item is the executable and the rest are arguments to the executable, each item may be a string or a list of strings and Substitutions to be resolved at runtime - :param prefix: a set of commands/arguments to preceed the cmd, used for + :param prefix: a set of commands/arguments to precede the cmd, used for things like gdb/valgrind and defaults to the LaunchConfiguration called 'launch-prefix'. Note that a non-default prefix provided in a launch file will override the prefix provided via the `launch-prefix` diff --git a/launch/launch/event_handlers/on_action_event_base.py b/launch/launch/event_handlers/on_action_event_base.py index 4b7423e1f..db677a8bf 100644 --- a/launch/launch/event_handlers/on_action_event_base.py +++ b/launch/launch/event_handlers/on_action_event_base.py @@ -53,7 +53,7 @@ def __init__( Construct a `OnActionEventBase` instance. :param action_matcher: `ExecuteProcess` instance or callable to filter events - from which proces/processes to handle. + from which process/processes to handle. :param on_event: Action to be done to handle the event. :param target_event_cls: A subclass of `Event`, indicating which events should be handled. diff --git a/launch/launch/frontend/expose.py b/launch/launch/frontend/expose.py index dd94596a0..7fc6d09af 100644 --- a/launch/launch/frontend/expose.py +++ b/launch/launch/frontend/expose.py @@ -70,7 +70,7 @@ def __expose_impl(name: Text, parse_methods_map: dict, exposed_type: Text): :param name: a string which specifies the key used for storing the parsing method in the dictionary. :param parse_methods_map: a dict where the parsing method will be stored. - :param exposed_type: A string specifing the parsing function type. + :param exposed_type: A string specifying the parsing function type. """ # TODO(ivanpauno): Check signature of the registered method/parsing function. # TODO(ivanpauno): Infer a parsing function from the constructor annotations. @@ -89,7 +89,7 @@ def expose_impl_decorator(exposed): if not found_parse_method: raise RuntimeError( 'Exposed {} parser for {} is not a callable or a class' - ' containg a parse method'.format(exposed_type, name) + ' containing a parse method'.format(exposed_type, name) ) if name in parse_methods_map and found_parse_method != parse_methods_map[name]: raise RuntimeError( diff --git a/launch/launch/frontend/parser.py b/launch/launch/frontend/parser.py index 2bfea7d98..f4dea5383 100644 --- a/launch/launch/frontend/parser.py +++ b/launch/launch/frontend/parser.py @@ -63,7 +63,7 @@ class Parser: They could also override the parse_substitution and/or get_file_extensions methods, or not. load_launch_extensions, parse_action, parse_description, get_available_extensions, may_parse, is_filename_valid, get_parsers_from_filename and get_file_extensions_from_parsers are not - supposed to be overriden. + supposed to be overridden. """ extensions_loaded = False diff --git a/launch/launch/launch_description.py b/launch/launch/launch_description.py index 7e134ba3c..eb8da1f81 100644 --- a/launch/launch/launch_description.py +++ b/launch/launch/launch_description.py @@ -116,7 +116,7 @@ def get_launch_arguments_with_include_launch_description_actions( context available. This function may fail, e.g. if the path to the launch file to include uses the values of launch configurations that have not been set yet, - and in that case the failure is ignored and the arugments defined in + and in that case the failure is ignored and the arguments defined in those launch files will not be seen either. Duplicate declarations of an argument are ignored, therefore the diff --git a/launch/launch/substitutions/environment_variable.py b/launch/launch/substitutions/environment_variable.py index a6606b96d..9439998f3 100644 --- a/launch/launch/substitutions/environment_variable.py +++ b/launch/launch/substitutions/environment_variable.py @@ -45,7 +45,7 @@ def __init__( default_value: Optional[SomeSubstitutionsType] = None ) -> None: """ - Construct an enviroment variable substitution. + Construct an environment variable substitution. :param name: name of the environment variable. :param default_value: used when the environment variable doesn't exist. diff --git a/launch/launch/substitutions/python_expression.py b/launch/launch/substitutions/python_expression.py index 3ee4fe957..5e69e785b 100644 --- a/launch/launch/substitutions/python_expression.py +++ b/launch/launch/substitutions/python_expression.py @@ -53,9 +53,25 @@ def __init__(self, expression: SomeSubstitutionsType) -> None: @classmethod def parse(cls, data: Iterable[SomeSubstitutionsType]): """Parse `PythonExpression` substitution.""" +<<<<<<< HEAD if len(data) != 1: raise TypeError('eval substitution expects 1 argument') return cls, {'expression': data[0]} +======= + if len(data) < 1 or len(data) > 2: + raise TypeError('eval substitution expects 1 or 2 arguments') + kwargs = {} + kwargs['expression'] = data[0] + if len(data) == 2: + # We get a text substitution from XML, + # whose contents are comma-separated module names + kwargs['python_modules'] = [] + # Check if we got empty list from XML + if len(data[1]) > 0: + modules_str = data[1][0].perform(None) + kwargs['python_modules'] = [module.strip() for module in modules_str.split(',')] + return cls, kwargs +>>>>>>> 2a84352 (Fixed typos (#692)) @property def expression(self) -> List[Substitution]: diff --git a/launch/launch/utilities/__init__.py b/launch/launch/utilities/__init__.py index f3efb4de5..941c39fb8 100644 --- a/launch/launch/utilities/__init__.py +++ b/launch/launch/utilities/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Package for utilties.""" +"""Package for utilities.""" from .class_tools_impl import is_a, is_a_subclass, isclassinstance from .create_future_impl import create_future diff --git a/launch/test/launch/frontend/test_expose_decorators.py b/launch/test/launch/frontend/test_expose_decorators.py index 529aa00ba..18ef4a0e2 100644 --- a/launch/test/launch/frontend/test_expose_decorators.py +++ b/launch/test/launch/frontend/test_expose_decorators.py @@ -45,6 +45,6 @@ def expose_test(name): with pytest.raises( RuntimeError, match='Exposed test parser for NotACallable is not a callable or a class' - ' containg a parse method' + ' containing a parse method' ): expose_test('NotACallable')(NotACallable) diff --git a/launch/test/launch/test_launch_description.py b/launch/test/launch/test_launch_description.py index 8da1703c2..c0ec57e68 100644 --- a/launch/test/launch/test_launch_description.py +++ b/launch/test/launch/test_launch_description.py @@ -70,7 +70,7 @@ def test_launch_description_get_launch_arguments(): la = ld.get_launch_arguments() assert len(la) == 1 - # From issue #144: get_launch_arguments was broken when an entitity had conditional + # From issue #144: get_launch_arguments was broken when an entity had conditional # sub entities class EntityWithConditional(LaunchDescriptionEntity): diff --git a/launch/test/launch/utilities/test_class_tools.py b/launch/test/launch/utilities/test_class_tools.py index fc3fa690f..5f6d7d7e0 100644 --- a/launch/test/launch/utilities/test_class_tools.py +++ b/launch/test/launch/utilities/test_class_tools.py @@ -94,7 +94,7 @@ class MockChildClass(MockParentClass): class MockNonRelativeClass: pass - # Test with class inheritence + # Test with class inheritance child = MockChildClass() other = MockNonRelativeClass() assert is_a(child, MockChildClass) diff --git a/launch/test/launch/utilities/test_ensure_argument_type.py b/launch/test/launch/utilities/test_ensure_argument_type.py index c89cce4bc..b49bc75ac 100644 --- a/launch/test/launch/utilities/test_ensure_argument_type.py +++ b/launch/test/launch/utilities/test_ensure_argument_type.py @@ -32,7 +32,7 @@ class MockClass: mock_class_obj = MockClass() ensure_argument_type(mock_class_obj, MockClass, 'MockClass') - # With inheritence + # With inheritance class MockChildClass(MockClass): pass diff --git a/launch_pytest/README.md b/launch_pytest/README.md index 538f5d4fe..94be8e82e 100644 --- a/launch_pytest/README.md +++ b/launch_pytest/README.md @@ -87,7 +87,7 @@ Neither of the three things above automatically generates an error in the curren #### Active Tests and shutdwon tests -Test cases marked with `@pytest.mark.launch` will be run concurrently with the launch service or after launch shutdown, depending on the object being marked and the mark arguements. +Test cases marked with `@pytest.mark.launch` will be run concurrently with the launch service or after launch shutdown, depending on the object being marked and the mark arguments. - functions: Functions marked with `@pytest.mark.launch` will run concurrently with the launch service, except when `shutdown=True` is passed as an argument to the decorator. diff --git a/launch_testing/README.md b/launch_testing/README.md index dbb91da58..7f9f897ca 100644 --- a/launch_testing/README.md +++ b/launch_testing/README.md @@ -6,7 +6,7 @@ This tool is a framework for launch integration testing. For example: * Tests can check that all processes shut down normally, or with specific exit codes. * Tests can fail when a process dies unexpectedly. * The stdout and stderr of all processes are available to the tests. - * The command-line used to launch the processes are avilalbe to the tests. + * The command-line used to launch the processes are available to the tests. * Some tests run concurrently with the launch and can interact with the running processes. ## Quick start example @@ -46,7 +46,7 @@ In the above example, there is no need to delay the start of the tests so the `R #### Active Tests -Any classes that inherit from `unittest.TestCase` and not decorated with the `post_shutdown_test` descriptor will be run concurrently with the proccess under test. +Any classes that inherit from `unittest.TestCase` and not decorated with the `post_shutdown_test` descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way. #### Post-Shutdown Tests @@ -194,7 +194,7 @@ Usage: launch_test test/launch_testing/examples/hello_world_launch_test.py ``` -This test is a simple example on how to use the ``launch_testing``. +This test is a simple example on how to use the ``launch_testing``. It launches a process and asserts that it prints "hello_world" to ``stdout`` using ``proc_output.assertWaitFor()``. Finally, it checks if the process exits normally (zero exit code). diff --git a/launch_testing/launch_testing/asserts/assert_sequential_output.py b/launch_testing/launch_testing/asserts/assert_sequential_output.py index 891f1718f..35c1a825b 100644 --- a/launch_testing/launch_testing/asserts/assert_sequential_output.py +++ b/launch_testing/launch_testing/asserts/assert_sequential_output.py @@ -103,7 +103,7 @@ def assertSequentialStdout(proc_output, process, cmd_args=None): """ - Create a context manager used to check stdout occured in a specific order. + Create a context manager used to check stdout occurred in a specific order. :param proc_output: The captured output from a test run @@ -120,7 +120,7 @@ def assertSequentialStdout(proc_output, process=process, cmd_args=cmd_args, # There's no good way to sequence output from multiple processes reliably, so we won't - # pretend to be able to. Only allow one matching process for the comination of proc and + # pretend to be able to. Only allow one matching process for the combination of proc and # cmd_args strict_proc_matching=True, )[0] diff --git a/launch_testing/test/launch_testing/examples/context_launch_test.py b/launch_testing/test/launch_testing/examples/context_launch_test.py index 21a81b4b6..b20b60a7f 100644 --- a/launch_testing/test/launch_testing/examples/context_launch_test.py +++ b/launch_testing/test/launch_testing/examples/context_launch_test.py @@ -42,7 +42,7 @@ def get_test_process_action(): ) -# This launch description shows the prefered way to let the tests access launch actions. By +# This launch description shows the preferred way to let the tests access launch actions. By # adding them to the test context, it's not necessary to scope them at the module level like in # the good_proc.test.py example @pytest.mark.launch_test diff --git a/launch_testing/test/launch_testing/test_sequential_output_checker.py b/launch_testing/test/launch_testing/test_sequential_output_checker.py index c56254634..0c63852dd 100644 --- a/launch_testing/test/launch_testing/test_sequential_output_checker.py +++ b/launch_testing/test/launch_testing/test_sequential_output_checker.py @@ -98,7 +98,7 @@ def test_mixed_multi_line(self): # two lines after # The test cases below check that the error message contains useful information for the # following test cases: - # 1. No matching has ocurred yet + # 1. No matching has occurred yet # 2. We just matched the first line of output so there are no lines before to print # 3. We just matched the last line of output so there are no lines after to print # 4. We just matched the second line of output so there is only one line before to print diff --git a/launch_xml/launch_xml/entity.py b/launch_xml/launch_xml/entity.py index 3c1a0aa3b..c7dae5eb8 100644 --- a/launch_xml/launch_xml/entity.py +++ b/launch_xml/launch_xml/entity.py @@ -36,7 +36,7 @@ def __init__( *, parent: 'Entity' = None ) -> Text: - """Construnctor.""" + """Construct the Entity.""" self.__xml_element = xml_element self.__parent = parent self.__read_attributes = set()