mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Updated for lower and upper
This commit is contained in:
parent
58f907e919
commit
8046b98027
3 changed files with 17 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
## slpkg - ChangeLog
|
||||
|
||||
### 5.0.6 - 13/04/2024
|
||||
- Update:
|
||||
* Updated to read repositories.toml values file even they are lower or uppercase
|
||||
|
||||
### 5.0.5 - 12/04/2024
|
||||
- Added:
|
||||
* Added maximum parallel for downloading in the config file
|
||||
|
|
|
@ -11,12 +11,14 @@ from pathlib import Path
|
|||
from dataclasses import dataclass
|
||||
|
||||
from slpkg.configs import Configs
|
||||
from slpkg.utilities import Utilities
|
||||
from slpkg.toml_errors import TomlErrors
|
||||
|
||||
|
||||
@dataclass
|
||||
class Repositories:
|
||||
toml_errors = TomlErrors()
|
||||
utils = Utilities()
|
||||
|
||||
repositories_toml_file: Path = Path(Configs.etc_path, 'repositories.toml')
|
||||
repositories_path: Path = Path(Configs.lib_path, 'repos')
|
||||
|
@ -221,6 +223,8 @@ class Repositories:
|
|||
with open(repositories_toml_file, 'rb') as repo:
|
||||
repos_config = tomli.load(repo)
|
||||
|
||||
repos_config = utils.convert_dict_keys_to_upper(repos_config)
|
||||
|
||||
default_repository: str = repos_config['DEFAULT']['REPO'].lower()
|
||||
|
||||
sbo_repo: bool = repos_config['SBO']['ENABLE']
|
||||
|
|
|
@ -221,3 +221,12 @@ class Utilities(Configs):
|
|||
pattern: str = '|'.join(blacklist)
|
||||
matching_packages: list = [pkg for pkg in packages if re.search(pattern, pkg)]
|
||||
return matching_packages
|
||||
|
||||
def convert_dict_keys_to_upper(self, d):
|
||||
new_dict = {}
|
||||
for key, value in d.items():
|
||||
if isinstance(value, dict):
|
||||
value = self.convert_dict_keys_to_upper(value)
|
||||
new_dict[key.upper()] = value
|
||||
return new_dict
|
||||
|
||||
|
|
Loading…
Reference in a new issue