Skip to content

Commit 40b2ce5

Browse files
authored
Merge pull request #146 from kneasle/rename-bot-to-wheatley
Replace remaining instances of 'bot' with 'Wheatley'
2 parents dfbdc5d + d92d1b2 commit 40b2ce5

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Pull requests are welcome, but please
33
[make an issue](https://github.com/Kneasle/ringing-room-bot/issues/new) to discuss the changes
44
before starting to implement things.
55

6-
To run the bot **from source code**, `cd` to the repository directory and run:
6+
To run Wheatley **from source code**, `cd` to the repository directory and run:
77
```bash
88
python3 run-wheatley [ARGS]
99
```
@@ -23,15 +23,15 @@ Or, on Unix you can run `./run-wheatley [ARGS]`.
2323
├── setup.py => Build script run to generate the PIP package
2424
├── wheatley
2525
│   ├── __init__.py => Empty file
26-
│   ├── __main__.py => Code to start the bot
26+
│   ├── __main__.py => Code to start Wheatley
2727
│ ├── arg_parsing.py => Code to parse formatted CLI args e.g. call strings
2828
│   ├── bell.py => Stores the representation of a bell
29-
│   ├── bot.py => The main class for the bot
29+
│   ├── bot.py => The main class for Wheatley
3030
│   ├── calls.py => Constants for the calls used in Ringing Room
31-
│   ├── main.py => Entry point of the bot
31+
│   ├── main.py => Entry point of Wheatley
3232
│   ├── page_parser.py => Code to parse the ringing room HTML
3333
│   ├── regression.py => Code for the weighted linear regression
34-
│   ├── rhythm.py => Code used to drive the bot's rhythm
34+
│   ├── rhythm.py => Code used to drive Wheatley's rhythm
3535
│   ├── tower.py => Code used to interact with ringing room
3636
│   └── row_generation => Modular row generators
3737
│    ├── __init__.py

wheatley/bot.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class Bot:
2828
"""
29-
A class to hold all the information that the bot will use to glue together the rhythm,
29+
A class to hold all the information that Wheatley will use to glue together the rhythm,
3030
row_gen and socket-io parts together into a useful program.
3131
"""
3232

@@ -176,7 +176,7 @@ def look_to_has_been_called(self, call_time: float) -> None:
176176
self._should_start_method = False
177177
self._should_start_ringing_rounds = False
178178

179-
# Reset the state, so that the bot starts by ringing rounds
179+
# Reset the state, so that Wheatley starts by ringing rounds
180180
self._is_ringing = True
181181
self._is_ringing_rounds = True
182182

@@ -312,8 +312,8 @@ def tick(self) -> None:
312312

313313
def main_loop(self) -> None:
314314
"""
315-
The main_loop of the bot.
316-
The main thread will get stuck forever in this function whilst the bot rings.
315+
Wheatley's main loop. The main thread will get stuck forever in this function whilst
316+
Wheatley rings.
317317
"""
318318
while True:
319319
# Log a message to say that Wheatley is waiting for 'Look To!'
@@ -340,10 +340,9 @@ def main_loop(self) -> None:
340340
self._tower.set_is_ringing(False)
341341

342342
def _user_assigned_bell(self, bell: Bell) -> bool:
343-
""" True when the bell is assigned to a different user name than given to the bot """
343+
""" Returns `True` if this bell is not assigned to Wheatley. """
344344
return not self._bot_assigned_bell(bell)
345345

346346
def _bot_assigned_bell(self, bell: Bell) -> bool:
347-
""" True when the bell is assigned to the user name given to the bot
348-
or bell is unassigned when user name is not set"""
347+
""" Returns `True` if this bell **is** assigned to Wheatley. """
349348
return self._tower.is_bell_assigned_to(bell, self._user_name)

wheatley/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python3
22

33
"""
4-
The file containing the main function for the bot, as well as all the command line argument parsing
5-
required to make the bot easily configurable.
4+
The file containing the main function for Wheatley, as well as all the command line argument parsing
5+
required to make Wheatley easily configurable.
66
"""
77

88
import argparse
@@ -216,9 +216,9 @@ def server_main(override_args: Optional[List[str]], stop_on_join_tower: bool) ->
216216

217217
def console_main(override_args: Optional[List[str]], stop_on_join_tower: bool) -> None:
218218
"""
219-
The main function of the bot.
219+
The main function of Wheatley, when called from the Command Line.
220220
This parses the CLI arguments, creates the Rhythm, RowGenerator and Bot objects, then starts
221-
the bot's mainloop.
221+
Wheatley's mainloop.
222222
223223
The two optional arguments are used by the integration tester to give Wheatley artificial argument values
224224
(override_args) and make Wheatley exit with error code 0 on joining a tower so that hanging forever
@@ -250,8 +250,8 @@ def console_main(override_args: Optional[List[str]], stop_on_join_tower: bool) -
250250
"--name",
251251
default=None,
252252
type=str,
253-
help="If set, then the bot will ring bells assigned to the given name. \
254-
When not set, the bot rings unassigned bells."
253+
help="If set, then Wheatley will ring bells assigned to the given name. \
254+
When not set, Wheatley rings unassigned bells."
255255
)
256256

257257
# Row generation arguments

wheatley/rhythm/regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,13 @@ def initialise_line(self, stage: int, user_controls_treble: bool, start_time: fl
290290
self._real_start_time = start_time
291291

292292
if not user_controls_treble:
293-
# If the bot is ringing the first bell, then add it as a datapoint anyway, so that after
293+
# If Wheatley is ringing the first bell, then add it as a datapoint anyway, so that after
294294
# the 2nd bell is rung, a regression line can be made
295295
self._add_data_point(0, 0, start_time, 1)
296296
self._start_time = start_time
297297
else:
298-
# If the bot isn't ringing the first bell, then set the expected time of the first bell
299-
# to infinity so that the bot will wait indefinitely for the first bell to ring, and
298+
# If Wheatley isn't ringing the first bell, then set the expected time of the first bell
299+
# to infinity so that Wheatley will wait indefinitely for the first bell to ring, and
300300
# then it will extrapolate from that time
301301
self._start_time = float('inf')
302302

wheatley/row_generation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Module to handle generation of rows for the bot to ring. """
1+
""" Module to handle generation of rows for Wheatley to ring. """
22

33
from .complib_composition_generator import ComplibCompositionGenerator
44
from .dixonoids_generator import DixonoidsGenerator

0 commit comments

Comments
 (0)