Fixed comment format (now renders properly)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Message sender component.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import random
|
||||
import string
|
||||
from communicator import Communicator
|
||||
|
||||
"""
|
||||
Message sender component
|
||||
"""
|
||||
|
||||
__author__ = "@kovacsbence"
|
||||
__copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
||||
__module_name__ = "messagesender"
|
||||
@ -19,18 +20,19 @@ LOGGER = logging.getLogger(__name__)
|
||||
|
||||
class MessageSender:
|
||||
"""
|
||||
Component responsible for sending the messages. Requires an instance of :class:'communicator.Communicator'
|
||||
Component responsible for sending the messages. Requires an instance of :class:`communicator.Communicator`.
|
||||
"""
|
||||
|
||||
def __init__(self, communicator: Communicator):
|
||||
"""Initializes the object.
|
||||
:param: communicator: an instance of :class:'communicator.Communicator'
|
||||
|
||||
:param communicator: an instance of :class:`communicator.Communicator`.
|
||||
"""
|
||||
self.communicator = communicator
|
||||
|
||||
def randomstring(self, stringlength: int) -> str:
|
||||
"""
|
||||
Generate a random string of fixed length
|
||||
"""Generate a random string of fixed length
|
||||
|
||||
:param stringlength: the length of the string
|
||||
:return: the generated string
|
||||
"""
|
||||
@ -39,10 +41,12 @@ class MessageSender:
|
||||
|
||||
def sendmessage(self, message: str = "") -> None:
|
||||
"""Sends the given message.
|
||||
|
||||
If the message is omitted (empty), then a random message will be generated with length 23 (with
|
||||
:func:'~messagesender.MessageSender.randomstring'. Calls :func:'~communicator.Communicator.sendmessage'
|
||||
:func:`messagesender.MessageSender.randomstring`. Calls :func:`communicator.Communicator.sendmessage`
|
||||
to send the message.
|
||||
:param message: the message of type string that will be sent
|
||||
|
||||
:param message: the message of type string that will be sent.
|
||||
:return: None
|
||||
"""
|
||||
if not message:
|
||||
|
Reference in New Issue
Block a user