mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Updated docstrings
This commit is contained in:
parent
3414ea2d9c
commit
cc22ea9d70
1 changed files with 7 additions and 16 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue