Clean up some pylint warnings in messages.py

Add a module doc string
Remove an extraneous else:
This commit is contained in:
Eryn Wells 2022-05-16 20:49:01 -07:00
parent e5485300ef
commit d5f6cbe73a

View file

@ -1,5 +1,11 @@
# Eryn Wells <eryn@erynwells.me> # Eryn Wells <eryn@erynwells.me>
'''
Defines the classes the support the in-game message log. Messages are recorded to the log as game actions are handled. A
short buffer of messages is displayed in the game's HUD, and a full list of messages can be viewed by the player at any
time.
'''
import textwrap import textwrap
from typing import List, Optional, Reversible, Tuple from typing import List, Optional, Reversible, Tuple
@ -30,8 +36,7 @@ class Message:
'''The full text of the message, including a count of repeats, if present''' '''The full text of the message, including a count of repeats, if present'''
if self.count == 1: if self.count == 1:
return self.text return self.text
else: return f'{self.text} (x{self.count})'
return f'{self.text} (x{self.count})'
def __str__(self) -> str: def __str__(self) -> str:
return self.text return self.text