Set for capital

This commit is contained in:
Dimitris Zlatanidis 2023-02-28 13:48:49 +02:00
parent 546930bd7b
commit b3464c3738

View file

@ -54,16 +54,20 @@ class Configs:
sbo_tar_suffix: str = '.tar.gz' sbo_tar_suffix: str = '.tar.gz'
sbo_repo_tag: str = '_SBo' sbo_repo_tag: str = '_SBo'
# ponce repo configs
ponce_repo: bool = False
ponce_repo_url: str = 'https://cgit.ponce.cc/slackbuilds/plain'
# Slackware commands # Slackware commands
installpkg: str = 'upgradepkg --install-new' installpkg: str = 'upgradepkg --install-new'
reinstall: str = 'upgradepkg --reinstall' reinstall: str = 'upgradepkg --reinstall'
removepkg: str = 'removepkg' removepkg: str = 'removepkg'
# Cli menu colors configs # Cli menu colors configs
colors: str = True colors: bool = True
# Dialog utility # Dialog utility
dialog: str = True dialog: bool = True
# Downloader command. Wget and curl. # Downloader command. Wget and curl.
downloader = 'wget' downloader = 'wget'
@ -75,11 +79,11 @@ class Configs:
curl_options = '' curl_options = ''
# Choose the view mode # Choose the view mode
silent_mode: str = True silent_mode: bool = True
# Choose ascii characters. # Choose ascii characters.
# If True use extended else basic. # If True use extended else basic.
ascii_characters = True ascii_characters: bool = True
# Load configurations from the file. # Load configurations from the file.
load = LoadConfigs() load = LoadConfigs()
@ -89,49 +93,52 @@ class Configs:
if config: if config:
try: try:
# OS architecture by default # OS architecture by default
os_arch: str = config['os_arch'] os_arch: str = config['OS_ARCH']
# All necessary paths # All necessary paths
tmp_slpkg: str = config['tmp_slpkg'] tmp_slpkg: str = config['TMP_SLPKG']
build_path: str = config['build_path'] build_path: str = config['BUILD_PATH']
download_only: str = config['download_only'] download_only: str = config['DOWNLOAD_ONLY']
sbo_repo_path: str = config['sbo_repo_path'] sbo_repo_path: str = config['SBO_REPO_PATH']
# Database name # Database name
database_name: str = config['database_name'] database_name: str = config['DATABASE_NAME']
# SBo repository details # SBo repository details
sbo_repo_url: str = config['sbo_repo_url'] sbo_repo_url: str = config['SBO_REPO_URL']
sbo_txt: str = config['sbo_txt'] sbo_txt: str = config['SBO_TXT']
sbo_chglog_txt: str = config['sbo_chglog_txt'] sbo_chglog_txt: str = config['SBO_CHGLOG_TXT']
sbo_tar_suffix: str = config['sbo_tar_suffix'] sbo_tar_suffix: str = config['SBO_TAR_SUFFIX']
sbo_repo_tag: str = config['sbo_repo_tag'] sbo_repo_tag: str = config['SBO_REPO_TAG']
ponce_repo: bool = config['PONCE_REPO']
ponce_repo_url: str = config['PONCE_REPO_URL']
# Slackware commands # Slackware commands
installpkg: str = config['installpkg'] installpkg: str = config['INSTALLPKG']
reinstall: str = config['reinstall'] reinstall: str = config['REINSTALL']
removepkg: str = config['removepkg'] removepkg: str = config['REMOVEPKG']
# Cli menu colors configs # Cli menu colors configs
colors: str = config['colors'] colors: str = config['COLORS']
# Dialog utility # Dialog utility
dialog: str = config['dialog'] dialog: str = config['DIALOG']
# Downloader command # Downloader command
downloader: str = config['downloader'] downloader: str = config['DOWNLOADER']
# Wget options # Wget options
wget_options: str = config['wget_options'] wget_options: str = config['WGET_OPTIONS']
# Curl options # Curl options
curl_options: str = config['curl_options'] curl_options: str = config['CURL_OPTIONS']
# Choose the view mode # Choose the view mode
silent_mode: str = config['silent_mode'] silent_mode: bool = config['SILENT_MODE']
# Choose ascii characters. Extended or basic. # Choose ascii characters. Extended or basic.
ascii_characters: str = config['ascii_characters'] ascii_characters: bool = config['ASCII_CHARACTERS']
except KeyError as error: except KeyError as error:
raise SystemExit(f"\nKeyError: {error}: in the configuration file '/etc/slpkg/slpkg.toml'.\n" raise SystemExit(f"\nKeyError: {error}: in the configuration file '/etc/slpkg/slpkg.toml'.\n"