Skip to content

Commit

Permalink
Fixed typos (#692)
Browse files Browse the repository at this point in the history
* Fixed typos
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
(cherry picked from commit 2a84352)

# Conflicts:
#	launch/launch/substitutions/python_expression.py
  • Loading branch information
ahcorde authored and mergify[bot] committed Feb 24, 2023
1 parent aed025e commit b7c735c
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 23 deletions.
4 changes: 2 additions & 2 deletions launch/launch/actions/execute_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion launch/launch/descriptions/executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion launch/launch/event_handlers/on_action_event_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions launch/launch/frontend/expose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion launch/launch/frontend/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion launch/launch/launch_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion launch/launch/substitutions/environment_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 16 additions & 0 deletions launch/launch/substitutions/python_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
2 changes: 1 addition & 1 deletion launch/launch/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion launch/test/launch/frontend/test_expose_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion launch/test/launch/test_launch_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
2 changes: 1 addition & 1 deletion launch/test/launch/utilities/test_class_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion launch/test/launch/utilities/test_ensure_argument_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion launch_pytest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions launch_testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion launch_xml/launch_xml/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b7c735c

Please sign in to comment.