Fixed for assignment

This commit is contained in:
Dimitris Zlatanidis 2024-04-22 20:54:34 +03:00
parent 39f8f0f115
commit a7543cb703

View file

@ -1,6 +1,8 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# mypy: disable-error-code="no-redef"
import sys
from pathlib import Path
@ -35,7 +37,6 @@ signal(SIGPIPE, SIG_DFL)
class Menu(Configs):
def __init__(self, args: list):
super(Configs).__init__()
self.args: list = args
self.flags: list = []
self.directory: str = str(self.tmp_slpkg)
@ -398,7 +399,7 @@ class Menu(Configs):
remove_args.append(self.directory)
except IndexError:
self.directory: str = ''
try:
if arg == self.flag_short_repository:
self.repository: str = self.args[self.args.index(arg) + 1]
@ -475,13 +476,13 @@ class Menu(Configs):
raise SystemExit(0)
if self.repository not in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
install = Packages(
install_bin = Packages(
self.repository, self.data, packages, self.flags, mode=command)
install.execute()
install_bin.execute()
else:
install = Slackbuilds(
install_sbo = Slackbuilds(
self.repository, self.data, packages, self.flags, mode=command)
install.execute()
install_sbo.execute()
else:
self.usage.help_minimal(f"{self.prog_name}: invalid repository '{self.repository}'")
@ -533,11 +534,11 @@ class Menu(Configs):
self.check.package_exists_in_the_database(packages, self.data)
if self.repository not in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
install = Packages(self.repository, self.data, packages, self.flags, mode=command)
install.execute()
install_bin = Packages(self.repository, self.data, packages, self.flags, mode=command)
install_bin.execute()
else:
install = Slackbuilds(self.repository, self.data, packages, self.flags, mode=command)
install.execute()
install_sbo = Slackbuilds(self.repository, self.data, packages, self.flags, mode=command)
install_sbo.execute()
raise SystemExit(0)
self.usage.help_short(1)