Added docstrings to class intialisers

This commit is contained in:
Marek Wolan
2023-07-06 16:08:51 +01:00
parent 9167816896
commit 653d76ec62
23 changed files with 253 additions and 137 deletions

View File

@@ -3,17 +3,21 @@
class Protocol(object):
"""Protocol class.
:param _name: The protocol name
"""
"""Protocol class."""
def __init__(self, _name):
"""
Initialise a protocol.
:param _name: The name of the protocol
:type _name: str
"""
self.name = _name
self.load = 0 # bps
def get_name(self):
"""Gets the protocol name.
"""
Gets the protocol name.
Returns:
The protocol name
@@ -21,7 +25,8 @@ class Protocol(object):
return self.name
def get_load(self):
"""Gets the protocol load.
"""
Gets the protocol load.
Returns:
The protocol load (bps)
@@ -29,7 +34,8 @@ class Protocol(object):
return self.load
def add_load(self, _load):
"""Adds load to the protocol.
"""
Adds load to the protocol.
Args:
_load: The load to add

View File

@@ -5,14 +5,16 @@ from primaite.common.enums import SoftwareState
class Service(object):
"""Service class.
:param name: The service name.
:param port: The service port.
:param software_state: The service SoftwareState.
"""
"""Service class."""
def __init__(self, name: str, port: str, software_state: SoftwareState):
"""
Initialise a service.
:param name: The service name.
:param port: The service port.
:param software_state: The service SoftwareState.
"""
self.name = name
self.port = port
self.software_state = software_state