Skip to content

Commit

Permalink
Standardizing spelling of "initialize"
Browse files Browse the repository at this point in the history
  • Loading branch information
toomanybrians committed Sep 18, 2023
1 parent f3a7e72 commit 1c3f150
Show file tree
Hide file tree
Showing 177 changed files with 400 additions and 401 deletions.
4 changes: 2 additions & 2 deletions mpf/assets/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Show:
"_step_cache", "machine"]

def __init__(self, machine, name):
"""Initialise show."""
"""initialize show."""
self.machine = machine
self._autoplay_settings = dict()
self.tokens = set()
Expand Down Expand Up @@ -493,7 +493,7 @@ class RunningShow:
# pylint: disable-msg=too-many-arguments
# pylint: disable-msg=too-many-locals
def __init__(self, machine, show, start_step, start_running, callback, start_time, start_callback, show_config):
"""Initialise an instance of a show."""
"""initialize an instance of a show."""
self.machine = machine
self.show = show
self.show_config = show_config
Expand Down
4 changes: 2 additions & 2 deletions mpf/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MpfCommandLineParser:
"""Base class for cli commands."""

def __init__(self, args, path):
"""Initialise CLI entry point."""
"""initialize CLI entry point."""
self.argv = args
self.path = path
self.mpf_path = os.path.abspath(os.path.join(mpf.core.__path__[0],
Expand Down Expand Up @@ -127,7 +127,7 @@ class CommandLineUtility(MpfCommandLineParser):
"""Default CLI entry point."""

def __init__(self, path=None):
"""Initialise CLI entry point."""
"""initialize CLI entry point."""
super().__init__(path=path, args=sys.argv[:])
self.external_commands = dict()
self.get_external_commands()
Expand Down
12 changes: 6 additions & 6 deletions mpf/commands/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def __init__(self, args, path):

def scan(self):
"""Scan hardware."""
self.mpf.clock.loop.run_until_complete(self.mpf.initialise_core_and_hardware())
self.mpf.clock.loop.run_until_complete(self.mpf.initialize_core_and_hardware())
if self.mpf.thread_stopper.is_set():
raise AssertionError("Initialisation failed!")
raise AssertionError("initialization failed!")

for name, platform in self.mpf.hardware_platforms.items():
print("{}:".format(name))
Expand All @@ -58,9 +58,9 @@ def scan(self):

def firmware_update(self):
"""Upgrade firmware of platforms."""
self.mpf.clock.loop.run_until_complete(self.mpf.initialise_core_and_hardware())
self.mpf.clock.loop.run_until_complete(self.mpf.initialize_core_and_hardware())
if self.mpf.thread_stopper.is_set():
raise AssertionError("Initialisation failed!")
raise AssertionError("initialization failed!")

for name, platform in self.mpf.hardware_platforms.items():
print("{}:".format(name))
Expand Down Expand Up @@ -140,9 +140,9 @@ def _test_repeated_pulses_with_rule(self, config, pulse_ms, pause_min, pause_max

def benchmark(self):
"""Benchmark hardware."""
self.mpf.clock.loop.run_until_complete(self.mpf.initialise())
self.mpf.clock.loop.run_until_complete(self.mpf.initialize())
if self.mpf.thread_stopper.is_set():
raise AssertionError("Initialisation failed!")
raise AssertionError("initialization failed!")

print(self.mpf.switches, self.mpf.coils)
config = self.mpf.config_validator.validate_config("hardware_benchmark",
Expand Down
2 changes: 1 addition & 1 deletion mpf/commands/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ServiceCli(cmd.Cmd):
prompt = "(service) "

def __init__(self, bcp_client, loop, stdin=None, stdout=None):
"""Initialise service cli."""
"""initialize service cli."""
super().__init__(stdin=stdin, stdout=stdout)
self.bcp_client = bcp_client
# start service mode
Expand Down
2 changes: 1 addition & 1 deletion mpf/commands/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, mpf_path, machine_path, args):
# print(config.get_machine_config())

self.machine = MachineController(vars(self.args), config)
self.machine.initialise_mpf()
self.machine.initialize_mpf()

result = wire(self.machine)

Expand Down
4 changes: 2 additions & 2 deletions mpf/config_players/bcp_plugin_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BcpPluginPlayer(DeviceConfigPlayer):
__slots__ = ["bcp_client"]

def __init__(self, machine):
"""Initialise plugin player."""
"""initialize plugin player."""
super().__init__(machine)
self.bcp_client = None
self.instances['_global_bcp'] = dict()
Expand All @@ -33,7 +33,7 @@ def _get_bcp_client(self, config):
def _add_handlers(self):
self.machine.events.add_handler('init_phase_1', self._initialize_mode_handlers, priority=20)
# since bcp is connecting in init_phase_2 we have to postpone this
self.machine.events.add_handler('init_phase_3', self._initialise_system_wide)
self.machine.events.add_handler('init_phase_3', self._initialize_system_wide)

def process_mode_config(self, config, root_config_dict, mode, **kwargs):
"""Create bcp context."""
Expand Down
2 changes: 1 addition & 1 deletion mpf/config_players/event_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EventPlayer(FlatConfigPlayer):
__slots__ = ["delay"]

def __init__(self, machine):
"""Initialise EventPlayer."""
"""initialize EventPlayer."""
super().__init__(machine)
self.delay = DelayManager(self.machine)

Expand Down
2 changes: 1 addition & 1 deletion mpf/config_players/flasher_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FlasherPlayer(DeviceConfigPlayer):
__slots__ = ["delay"]

def __init__(self, machine):
"""Initialise flasher_player."""
"""initialize flasher_player."""
super().__init__(machine)
self.delay = DelayManager(self.machine)

Expand Down
4 changes: 2 additions & 2 deletions mpf/config_players/plugin_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PluginPlayer(DeviceConfigPlayer):
__slots__ = ["bcp_client", "_show_keys"]

def __init__(self, machine):
"""Initialise plugin player."""
"""initialize plugin player."""
super().__init__(machine)
self.bcp_client = None
self._show_keys = {}
Expand Down Expand Up @@ -40,7 +40,7 @@ def _add_handlers(self):
self._initialize_mode_handlers, priority=20)
# since bcp is connecting in init_phase_2 we have to postpone this
self.machine.events.add_handler('init_phase_3',
self._initialise_system_wide)
self._initialize_system_wide)

def register_player_events(self, config, mode=None, priority=0):
"""Register player events via BCP.
Expand Down
2 changes: 1 addition & 1 deletion mpf/config_players/random_event_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RandomEventPlayer(ConfigPlayer):
__slots__ = ["_machine_wide_dict"]

def __init__(self, machine):
"""Initialise random event player."""
"""initialize random event player."""
super().__init__(machine)
self._machine_wide_dict = {}

Expand Down
2 changes: 1 addition & 1 deletion mpf/config_players/segment_display_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SegmentDisplayPlayer(DeviceConfigPlayer):
__slots__ = ["delay"]

def __init__(self, machine):
"""Initialise SegmentDisplayPlayer."""
"""initialize SegmentDisplayPlayer."""
super().__init__(machine)
self.delay = DelayManager(self.machine)

Expand Down
2 changes: 1 addition & 1 deletion mpf/config_players/show_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ShowPlayer(DeviceConfigPlayer):
__slots__ = ["_actions"]

def __init__(self, machine):
"""Initialise show player."""
"""initialize show player."""
super().__init__(machine)
self._actions = {
'play': self._play,
Expand Down
2 changes: 1 addition & 1 deletion mpf/config_players/variable_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class VariablePlayer(ConfigPlayer):
__slots__ = ["blocks"]

def __init__(self, machine: MachineController) -> None:
"""Initialise variable player."""
"""initialize variable player."""
super().__init__(machine)
self.blocks = {} # type: Dict[str, List[VarBlock]]

Expand Down
8 changes: 4 additions & 4 deletions mpf/core/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BaseAssetManager(MpfController, LogMixin):
"num_bcp_assets_loaded", "_next_id", "_last_asset_event_time", "initial_assets_loaded", "_start_time"]

def __init__(self, machine: MachineController) -> None:
"""Initialise asset manager.
"""initialize asset manager.
Args:
----
Expand Down Expand Up @@ -650,7 +650,7 @@ class AssetPool:

# Could possibly combine some or make @properties?
def __init__(self, mc, name, config, member_cls):
"""Initialise asset pool."""
"""initialize asset pool."""
self.machine = mc
self.priority = None
self.name = name
Expand Down Expand Up @@ -886,7 +886,7 @@ class Asset:

@classmethod
def initialize(cls, machine):
"""Initialise asset class."""
"""initialize asset class."""
if not cls.disk_asset_section:
cls.disk_asset_section = cls.config_section

Expand All @@ -901,7 +901,7 @@ def initialize(cls, machine):
pool_config_section=cls.pool_config_section)

def __init__(self, machine, name, file, config):
"""Initialise asset."""
"""initialize asset."""
self.machine = machine # type: MachineController
self.name = name
self.file = file
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/async_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AsyncMode(Mode, metaclass=abc.ABCMeta):
__slots__ = ["_task"]

def __init__(self, machine: "MachineController", *args, **kwargs) -> None:
"""Initialise async mode."""
"""initialize async mode."""
super().__init__(machine, *args, **kwargs)

self._task = None # type: Optional[asyncio.Task]
Expand Down
4 changes: 2 additions & 2 deletions mpf/core/ball_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BallController(MpfController):
__slots__ = ["delay", "num_balls_known", "_add_new_balls_task", "_captured_balls"]

def __init__(self, machine: MachineController) -> None:
"""Initialise ball controller.
"""initialize ball controller.
Args:
----
Expand Down Expand Up @@ -160,7 +160,7 @@ def _count_balls(self) -> int:
return balls

def _initialize(self, **kwargs) -> None:
"""Initialise ball controller."""
"""initialize ball controller."""
# If there are no ball devices, then the ball controller has no work to
# do and will create errors, so we just abort.
del kwargs
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/bcp/bcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Bcp(MpfController):
__slots__ = ["interface", "transport", "servers", "enabled"]

def __init__(self, machine: "MachineController") -> None:
"""Initialise BCP module."""
"""initialize BCP module."""
super().__init__(machine)
self.interface = BcpInterface(machine)
self.transport = BcpTransportManager(machine)
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/bcp/bcp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BaseBcpClient(MpfController, metaclass=abc.ABCMeta):
__slots__ = ["name", "bcp", "exit_on_close"]

def __init__(self, machine, name, bcp):
"""Initialise client."""
"""initialize client."""
super().__init__(machine)
self.name = name
self.bcp = bcp
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/bcp/bcp_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BcpInterface(MpfController):
"_shows"]

def __init__(self, machine):
"""Initialise BCP."""
"""initialize BCP."""
super().__init__(machine)

if 'bcp' not in machine.config or not machine.config['bcp']:
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/bcp/bcp_pickle_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BcpPickleClient(BaseBcpClient):
"""BCP client using pickle."""

def __init__(self, machine, name, bcp):
"""Initialise BCP pickle client."""
"""initialize BCP pickle client."""
super().__init__(machine, name, bcp)
self._receiver = None
self._sender = None
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/bcp/bcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BcpServer(MpfController):
config_name = "bcp_server"

def __init__(self, machine, ip, port, server_type):
"""Initialise BCP server."""
"""initialize BCP server."""
super().__init__(machine)
self._server = None
self._ip = ip
Expand Down
4 changes: 2 additions & 2 deletions mpf/core/bcp/bcp_socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class AsyncioBcpClientSocket():
"""Simple asyncio bcp client."""

def __init__(self, sender, receiver):
"""Initialise BCP client socket."""
"""initialize BCP client socket."""
self._sender = sender
self._receiver = receiver
self._receive_buffer = b''
Expand Down Expand Up @@ -211,7 +211,7 @@ class BCPClientSocket(BaseBcpClient):
__slots__ = ["_sender", "_receiver", "_send_goodbye", "_receive_buffer", "_bcp_client_socket_commands", "__dict__"]

def __init__(self, machine, name, bcp):
"""Initialise BCP client socket."""
"""initialize BCP client socket."""
super().__init__(machine, name, bcp)

self._sender = None
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/bcp/bcp_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BcpTransportManager:
__slots__ = ["_machine", "_transports", "_readers", "_handlers"]

def __init__(self, machine):
"""Initialise BCP transport manager."""
"""initialize BCP transport manager."""
self._machine = machine # type: MachineController
self._transports = []
self._readers = {}
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/case_insensitive_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def lower(key):
return key.lower() if isinstance(key, str) else key

def __init__(self, *args, **kwargs):
"""Initialise case insensitve dict."""
"""initialize case insensitve dict."""
super().__init__(*args, **kwargs)
self._convert_keys()

Expand Down
4 changes: 2 additions & 2 deletions mpf/core/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PeriodicTask:
__slots__ = ["_canceled", "_interval", "_callback", "_loop", "_last_call"]

def __init__(self, interval, loop, callback):
"""Initialise periodic task."""
"""initialize periodic task."""
self._canceled = False
self._interval = interval
self._callback = callback
Expand Down Expand Up @@ -49,7 +49,7 @@ class ClockBase(LogMixin):
__slots__ = ["machine", "loop"]

def __init__(self, machine=None, loop=None):
"""Initialise clock."""
"""initialize clock."""
super().__init__()
self.machine = machine

Expand Down
6 changes: 3 additions & 3 deletions mpf/core/config_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ConfigPlayer(LogMixin, metaclass=abc.ABCMeta):
__slots__ = ["device_collection", "machine", "mode_event_keys", "instances", "_global_keys"]

def __init__(self, machine):
"""Initialise config player."""
"""initialize config player."""
super().__init__()
self.device_collection = None

Expand All @@ -55,7 +55,7 @@ def _shutdown(self, **kwargs):

def _add_handlers(self):
self.machine.events.add_handler('init_phase_1', self._initialize_mode_handlers, priority=20)
self.machine.events.add_handler('init_phase_1', self._initialise_system_wide, priority=1)
self.machine.events.add_handler('init_phase_1', self._initialize_system_wide, priority=1)

def __repr__(self):
"""Return string representation."""
Expand All @@ -74,7 +74,7 @@ def _initialize_mode_handlers(self, **kwargs):

# if self.config_file_section in self.machine.config:

def _initialise_system_wide(self, **kwargs):
def _initialize_system_wide(self, **kwargs):
del kwargs
if self.machine_collection_name:
self.device_collection = getattr(self.machine,
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/config_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ConfigProcessor:
__slots__ = ["log", "_load_cache", "_store_cache"]

def __init__(self, load_cache, store_cache):
"""Initialise config processor."""
"""initialize config processor."""
self.log = logging.getLogger("ConfigProcessor")
self._load_cache = load_cache
self._store_cache = store_cache
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/config_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ConfigValidator:
__slots__ = ["machine", "config_spec", "log", "validator_list"]

def __init__(self, machine, config_spec):
"""Initialise validator."""
"""initialize validator."""
self.machine = machine # type: MachineController
self.log = logging.getLogger('ConfigValidator')
self.config_spec = config_spec
Expand Down
2 changes: 1 addition & 1 deletion mpf/core/custom_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CustomCode(LogMixin):
__slots__ = ["machine", "name", "delay"]

def __init__(self, machine, name):
"""Initialise custom code."""
"""initialize custom code."""
super().__init__()
self.machine = machine
self.name = name
Expand Down
Loading

0 comments on commit 1c3f150

Please sign in to comment.