Added some comments

This commit is contained in:
Dimitris Zlatanidis 2022-06-19 19:26:30 +03:00
parent e0d11fe3dc
commit 3e3cb45ea7
7 changed files with 10 additions and 6 deletions

View file

@ -13,6 +13,7 @@ class Blacklist:
etc_path: str = Configs.etc_path
def get(self):
''' Reads and returns the blacklist. '''
file = f'{self.etc_path}/blacklist.json'
if os.path.isfile(file):
with open(file, 'r') as black:

View file

@ -11,6 +11,7 @@ from slpkg.blacklist import Blacklist
@dataclass
class Check:
''' Some checks before proceed. '''
log_packages: str = Configs.log_packages
repo_tag: str = Configs.repo_tag

View file

@ -11,6 +11,7 @@ from slpkg.models.models import session as Session
@dataclass
class CleanLogsDependencies:
''' Cleans the logs from packages. '''
flags: str
session: str = Session
@ -19,7 +20,6 @@ class CleanLogsDependencies:
LogsDependencies.name, LogsDependencies.requires).all()
if dependencies:
view = ViewMessage()
view.logs_packages(dependencies)
view.question(self.flags)

View file

@ -11,6 +11,7 @@ from slpkg.models.models import session as Session
@dataclass
class CreateData:
''' Reads the SLACKBUILDS.TXT file and inserts them into the database. '''
db_path: str = Configs.db_path
sbo_txt: str = Configs.sbo_txt

View file

@ -9,7 +9,7 @@ from slpkg.queries import SBoQueries
@dataclass
class Requires:
''' Creates a list of dependencies with
the right order to install '''
the right order to install. '''
name: str
def resolve(self) -> list:

View file

@ -9,6 +9,7 @@ from slpkg.configs import Configs
@dataclass
class Wget:
''' Wget donwloader. '''
wget_options: str = Configs.wget_options
def download(self, path: str, url: str):

View file

@ -13,14 +13,14 @@ from slpkg.models.models import session as Session
@dataclass
class RemovePackages:
''' Remove installed packages. '''
''' Removes installed packages. '''
packages: str
flags: list
session: str = Session
removepkg: str = Configs.removepkg
def remove(self):
''' Remove package with dependencies. '''
''' Removes package with dependencies. '''
self.installed_packages = []
self.dependencies = []
@ -44,14 +44,14 @@ class RemovePackages:
subprocess.call(command, shell=True)
def delete_main_logs(self):
''' Delete main packages from logs. '''
''' Deletes main packages from logs. '''
for pkg in self.packages:
self.session.query(LogsDependencies).filter(
LogsDependencies.name == pkg).delete()
self.session.commit()
def delete_deps_logs(self):
''' Delete depends packages from logs. '''
''' Deletes depends packages from logs. '''
for pkg in self.dependencies[0].split():
self.session.query(LogsDependencies).filter(
LogsDependencies.name == pkg).delete()