mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-07 08:46:21 +01:00
Refactor for load configs
This commit is contained in:
parent
262b23f6be
commit
ab9ff1137d
2 changed files with 6 additions and 6 deletions
|
@ -8,7 +8,7 @@ from pathlib import Path
|
|||
from dataclasses import dataclass
|
||||
|
||||
|
||||
class LoadConfigs:
|
||||
class Load:
|
||||
|
||||
def __init__(self):
|
||||
bold = '\033[1m'
|
||||
|
@ -17,7 +17,7 @@ class LoadConfigs:
|
|||
self.endc: str = '\x1b[0m'
|
||||
self.bred: str = f'{bold}{red}'
|
||||
|
||||
def file(self, path: str, file: str) -> dict: # type: ignore
|
||||
def config_file(self, path: str, file: str) -> dict: # type: ignore
|
||||
try:
|
||||
""" Load the configs from the file. """
|
||||
config_path_file = Path(path, f'{file}.toml')
|
||||
|
@ -120,8 +120,8 @@ class Configs:
|
|||
file_pattern_conf: str = ""
|
||||
|
||||
# Load configurations from the file.
|
||||
load = LoadConfigs()
|
||||
configs = load.file(etc_path, prog_name)
|
||||
load = Load()
|
||||
configs = load.config_file(etc_path, prog_name)
|
||||
|
||||
if configs:
|
||||
try:
|
||||
|
|
|
@ -5,7 +5,7 @@ import os
|
|||
from pathlib import Path
|
||||
|
||||
from slpkg.configs import Configs
|
||||
from slpkg.configs import LoadConfigs
|
||||
from slpkg.configs import Load
|
||||
from slpkg.dialog_box import DialogBox
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ class FormConfigs(Configs):
|
|||
|
||||
def __init__(self):
|
||||
super(Configs).__init__()
|
||||
self.load_configs = LoadConfigs()
|
||||
self.load_configs = Load()
|
||||
self.dialogbox = DialogBox()
|
||||
self.color = self.colour()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue