slpkg/slpkg/blacklist.py
Dimitris Zlatanidis 50ff4ed14f Rename configs files
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
2022-09-09 20:00:19 +03:00

21 lines
462 B
Python

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import yaml
from dataclasses import dataclass
from slpkg.configs import Configs
@dataclass
class Blacklist:
''' Reads and returns the blacklist. '''
etc_path: str = Configs.etc_path
def get(self):
file = f'{self.etc_path}/blacklist.yml'
if os.path.isfile(file):
with open(file, 'r') as black:
return yaml.safe_load(black)['blacklist']['packages']