mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Added for case-insensitive to configs
This commit is contained in:
parent
dd25d2d7c7
commit
cc14bcc2f3
3 changed files with 31 additions and 25 deletions
|
@ -55,6 +55,10 @@ PROGRESS_SPINNER = "pixel"
|
|||
# Default is green. [green/violet/yellow/blue/cyan/grey/red]
|
||||
SPINNER_COLOR = "green"
|
||||
|
||||
# Enable or disable case-insensitive pattern matching.
|
||||
# Default is false. [true/false]
|
||||
CASE_INSENSITIVE = false
|
||||
|
||||
# Slackware command for install packages, instead, you can use 'installpkg'.
|
||||
# Normally upgradepkg only upgrades packages that are already installed
|
||||
# on the system, and will skip any packages that do not already have a
|
||||
|
|
|
@ -35,7 +35,7 @@ class Configs:
|
|||
dialog: bool = True
|
||||
downloader: str = 'wget'
|
||||
wget_options: str = '--c -q --progress=bar:force:noscroll --show-progress'
|
||||
curl_options: str = ''
|
||||
curl_options: str = str()
|
||||
lftp_get_options: str = '-c get -e'
|
||||
lftp_mirror_options: str = '-c mirror --parallel=100 --only-newer'
|
||||
silent_mode: bool = True
|
||||
|
@ -46,10 +46,11 @@ class Configs:
|
|||
spinning_bar: str = True
|
||||
progress_spinner: str = 'pixel'
|
||||
spinner_color: str = 'green'
|
||||
case_insensitive: bool = False
|
||||
|
||||
proxy_address: str = ''
|
||||
proxy_username: str = ''
|
||||
proxy_password: str = ''
|
||||
proxy_address: str = str()
|
||||
proxy_username: str = str()
|
||||
proxy_password: str = str()
|
||||
|
||||
try:
|
||||
# Load user configuration.
|
||||
|
@ -82,6 +83,7 @@ class Configs:
|
|||
spinning_bar: str = config['SPINNING_BAR']
|
||||
progress_spinner: str = config['PROGRESS_SPINNER']
|
||||
spinner_color: str = config['SPINNER_COLOR']
|
||||
case_insensitive: bool = config['CASE_INSENSITIVE']
|
||||
proxy_address: str = config['PROXY_ADDRESS']
|
||||
proxy_username: str = config['PROXY_USERNAME']
|
||||
proxy_password: str = config['PROXY_PASSWORD']
|
||||
|
@ -89,19 +91,19 @@ class Configs:
|
|||
except (KeyError, tomli.TOMLDecodeError) as error:
|
||||
errors.raise_toml_error_message(error, toml_file='/etc/slpkg/slpkg.toml')
|
||||
|
||||
blink: str = ''
|
||||
bold: str = ''
|
||||
red: str = ''
|
||||
bred: str = ''
|
||||
green: str = ''
|
||||
bgreen: str = ''
|
||||
yellow: str = ''
|
||||
byellow: str = ''
|
||||
cyan: str = ''
|
||||
blue: str = ''
|
||||
grey: str = ''
|
||||
violet: str = ''
|
||||
endc: str = ''
|
||||
blink: str = str()
|
||||
bold: str = str()
|
||||
red: str = str()
|
||||
bred: str = str()
|
||||
green: str = str()
|
||||
bgreen: str = str()
|
||||
yellow: str = str()
|
||||
byellow: str = str()
|
||||
cyan: str = str()
|
||||
blue: str = str()
|
||||
grey: str = str()
|
||||
violet: str = str()
|
||||
endc: str = str()
|
||||
|
||||
if colors:
|
||||
blink: str = '\033[32;5m'
|
||||
|
|
|
@ -616,7 +616,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -643,7 +643,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -668,7 +668,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -703,7 +703,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -721,7 +721,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -745,7 +745,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -763,7 +763,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
@ -783,7 +783,7 @@ class Argparse(Configs):
|
|||
self.check.is_database_empty()
|
||||
packages: list = self.is_file_list_packages()
|
||||
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags):
|
||||
if self.utils.is_option(self.flag_no_cases, self.flags) or self.case_insensitive:
|
||||
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
|
||||
|
||||
if self.utils.is_option(self.flag_searches, self.flags):
|
||||
|
|
Loading…
Reference in a new issue