Always ensure that a command instance is given a canonical name.

development
Shawn Davis 2 years ago
parent 894abd05c0
commit f4e43e3d85
  1. 3
      scripttease/lib/factories.py

@ -57,6 +57,7 @@ def command_factory(loader, excluded_kwargs=None, mappings=None, profile=PROFILE
command = get_command(_mappings, command_name, *args, locations=loader.locations, **kwargs) command = get_command(_mappings, command_name, *args, locations=loader.locations, **kwargs)
if command is not None: if command is not None:
command.name = command_name
command.number = number command.number = number
if command.name == "template": if command.name == "template":
@ -84,7 +85,7 @@ def get_command(mappings, name, *args, locations=None, **kwargs):
args and kwargs are passed to the callback. args and kwargs are passed to the callback.
:rtype: scripttease.lib.commands.base.Command | scripttease.lib.commands.base.ItemizedCommand | :rtype: scripttease.lib.commands.base.Command | scripttease.lib.commands.base.ItemizedCommand |
scripttease.lib.commands.base.Template scripttease.lib.commands.base.Template | scripttease.lib.commands.base.MultipleCommands
""" """
# Args need to be mutable. # Args need to be mutable.

Loading…
Cancel
Save