Skip to content

Commit b7c735c

Browse files
ahcordemergify[bot]
authored andcommitted
Fixed typos (#692)
* Fixed typos Signed-off-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 2a84352) # Conflicts: # launch/launch/substitutions/python_expression.py
1 parent aed025e commit b7c735c

File tree

19 files changed

+39
-23
lines changed

19 files changed

+39
-23
lines changed

launch/launch/actions/execute_process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(
210210
:py:func:`evaluate_condition_expression`.
211211
Throws :py:exception:`InvalidConditionExpressionError` if the
212212
'emulate_tty' configuration does not represent a boolean.
213-
:param: prefix a set of commands/arguments to preceed the cmd, used for
213+
:param: prefix a set of commands/arguments to precede the cmd, used for
214214
things like gdb/valgrind and defaults to the LaunchConfiguration
215215
called 'launch-prefix'. Note that a non-default prefix provided in
216216
a launch file will override the prefix provided via the `launch-prefix`
@@ -264,7 +264,7 @@ def _append_arg():
264264
if isinstance(sub, TextSubstitution):
265265
tokens = shlex.split(sub.text)
266266
if not tokens:
267-
# Sting with just spaces.
267+
# String with just spaces.
268268
# Appending args allow splitting two substitutions
269269
# separated by a space.
270270
# e.g.: `$(subst1 asd) $(subst2 bsd)` will be two separate arguments.

launch/launch/descriptions/executable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959
:param cmd: A list where the first item is the executable and the rest are
6060
arguments to the executable, each item may be a string or a list of strings
6161
and Substitutions to be resolved at runtime
62-
:param prefix: a set of commands/arguments to preceed the cmd, used for
62+
:param prefix: a set of commands/arguments to precede the cmd, used for
6363
things like gdb/valgrind and defaults to the LaunchConfiguration
6464
called 'launch-prefix'. Note that a non-default prefix provided in
6565
a launch file will override the prefix provided via the `launch-prefix`

launch/launch/event_handlers/on_action_event_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(
5353
Construct a `OnActionEventBase` instance.
5454
5555
:param action_matcher: `ExecuteProcess` instance or callable to filter events
56-
from which proces/processes to handle.
56+
from which process/processes to handle.
5757
:param on_event: Action to be done to handle the event.
5858
:param target_event_cls: A subclass of `Event`, indicating which events
5959
should be handled.

launch/launch/frontend/expose.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __expose_impl(name: Text, parse_methods_map: dict, exposed_type: Text):
7070
:param name: a string which specifies the key used for storing the parsing
7171
method in the dictionary.
7272
:param parse_methods_map: a dict where the parsing method will be stored.
73-
:param exposed_type: A string specifing the parsing function type.
73+
:param exposed_type: A string specifying the parsing function type.
7474
"""
7575
# TODO(ivanpauno): Check signature of the registered method/parsing function.
7676
# TODO(ivanpauno): Infer a parsing function from the constructor annotations.
@@ -89,7 +89,7 @@ def expose_impl_decorator(exposed):
8989
if not found_parse_method:
9090
raise RuntimeError(
9191
'Exposed {} parser for {} is not a callable or a class'
92-
' containg a parse method'.format(exposed_type, name)
92+
' containing a parse method'.format(exposed_type, name)
9393
)
9494
if name in parse_methods_map and found_parse_method != parse_methods_map[name]:
9595
raise RuntimeError(

launch/launch/frontend/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Parser:
6363
They could also override the parse_substitution and/or get_file_extensions methods, or not.
6464
load_launch_extensions, parse_action, parse_description, get_available_extensions, may_parse,
6565
is_filename_valid, get_parsers_from_filename and get_file_extensions_from_parsers are not
66-
supposed to be overriden.
66+
supposed to be overridden.
6767
"""
6868

6969
extensions_loaded = False

launch/launch/launch_description.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_launch_arguments_with_include_launch_description_actions(
116116
context available.
117117
This function may fail, e.g. if the path to the launch file to include
118118
uses the values of launch configurations that have not been set yet,
119-
and in that case the failure is ignored and the arugments defined in
119+
and in that case the failure is ignored and the arguments defined in
120120
those launch files will not be seen either.
121121
122122
Duplicate declarations of an argument are ignored, therefore the

launch/launch/substitutions/environment_variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545
default_value: Optional[SomeSubstitutionsType] = None
4646
) -> None:
4747
"""
48-
Construct an enviroment variable substitution.
48+
Construct an environment variable substitution.
4949
5050
:param name: name of the environment variable.
5151
:param default_value: used when the environment variable doesn't exist.

launch/launch/substitutions/python_expression.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,25 @@ def __init__(self, expression: SomeSubstitutionsType) -> None:
5353
@classmethod
5454
def parse(cls, data: Iterable[SomeSubstitutionsType]):
5555
"""Parse `PythonExpression` substitution."""
56+
<<<<<<< HEAD
5657
if len(data) != 1:
5758
raise TypeError('eval substitution expects 1 argument')
5859
return cls, {'expression': data[0]}
60+
=======
61+
if len(data) < 1 or len(data) > 2:
62+
raise TypeError('eval substitution expects 1 or 2 arguments')
63+
kwargs = {}
64+
kwargs['expression'] = data[0]
65+
if len(data) == 2:
66+
# We get a text substitution from XML,
67+
# whose contents are comma-separated module names
68+
kwargs['python_modules'] = []
69+
# Check if we got empty list from XML
70+
if len(data[1]) > 0:
71+
modules_str = data[1][0].perform(None)
72+
kwargs['python_modules'] = [module.strip() for module in modules_str.split(',')]
73+
return cls, kwargs
74+
>>>>>>> 2a84352 (Fixed typos (#692))
5975

6076
@property
6177
def expression(self) -> List[Substitution]:

launch/launch/utilities/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Package for utilties."""
15+
"""Package for utilities."""
1616

1717
from .class_tools_impl import is_a, is_a_subclass, isclassinstance
1818
from .create_future_impl import create_future

launch/test/launch/frontend/test_expose_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ def expose_test(name):
4545
with pytest.raises(
4646
RuntimeError,
4747
match='Exposed test parser for NotACallable is not a callable or a class'
48-
' containg a parse method'
48+
' containing a parse method'
4949
):
5050
expose_test('NotACallable')(NotACallable)

0 commit comments

Comments
 (0)