Updated docstrings

This commit is contained in:
Dimitris Zlatanidis 2024-05-21 19:27:19 +03:00
parent 3414ea2d9c
commit cc22ea9d70

View file

@ -12,10 +12,7 @@ from slpkg.error_messages import Errors
class FormConfigs(Configs):
"""
Edit slpkg.toml config file with dialog utility.
"""
"""Edit slpkg.toml config file with dialog utility."""
def __init__(self):
super(Configs).__init__()
@ -27,15 +24,13 @@ class FormConfigs(Configs):
self.config_file: Path = Path(self.etc_path, f'{self.prog_name}.toml')
def is_dialog_enabled(self) -> None:
""" Checking if the dialog box is enabled by the user.
"""
"""Checking if the dialog box is enabled by the user."""
if not self.dialog:
self.errors.raise_error_message(f"You should enable the dialog in the "
f"'{self.etc_path}/{self.prog_name}.toml' file", exit_status=1)
def edit(self) -> None:
""" Read and write the configuration file.
"""
"""Read and write the configuration file."""
self.is_dialog_enabled()
elements: list = []
height: int = 9
@ -71,14 +66,12 @@ class FormConfigs(Configs):
self.edit()
def help(self) -> None:
""" Load the configuration file on a text box.
"""
"""Load the configuration file on a text box."""
self.dialogbox.textbox(str(self.config_file), 40, 60)
self.edit()
def check_configs(self, tags: list) -> bool:
""" Check for true of false values.
"""
"""Check for true of false values."""
keys: list = [
'COLORS',
'DIALOG',
@ -114,14 +107,12 @@ class FormConfigs(Configs):
return True
def read_configs(self) -> None:
""" Read the original config file.
"""
"""Read the original config file."""
with open(self.config_file, 'r', encoding='utf-8') as toml_file:
self.orig_configs: list = toml_file.readlines()
def write_file(self, tags: list) -> None:
""" Write the new values to the config file.
"""
"""Write the new values to the config file."""
self.read_configs()
with open(self.config_file, 'w', encoding='utf-8') as patch_toml: