Updated for __slots__

This commit is contained in:
Dimitris Zlatanidis 2023-05-05 13:07:24 +03:00
parent 4673a239b8
commit 7084400dc6
23 changed files with 5 additions and 24 deletions

View file

@ -25,7 +25,6 @@ from slpkg.models.models import session as Session
class Packages(Configs):
def __init__(self, repository: str, data: dict, packages: list, flags: list, mode: str):
__slots__ = 'repository', 'data', 'packages', 'flags', 'mode'
super(Configs, self).__init__()
self.data: dict = data
self.packages: list = packages

View file

@ -10,7 +10,6 @@ class BinQueries:
""" Queries class for the binary repositories. """
def __init__(self, repo: str):
__slots__ = 'repo'
self.repo: str = repo
self.session = Session

View file

@ -9,9 +9,9 @@ from slpkg.repositories import Repositories
class Required:
""" Creates a list of dependencies with
the right order to install. """
__slots__ = ('data', 'name', 'repos', 'special_repos', 'repo')
def __init__(self, data: dict, name: str):
__slots__ = 'data', 'name,'
self.data: dict = data
self.name: str = name
self.repos = Repositories()

View file

@ -14,7 +14,6 @@ class Check(Configs):
""" Some checks before proceed. """
def __init__(self, repository: str, data: dict):
__slots__ = 'repository', 'data'
super(Configs, self).__init__()
self.data: dict = data
self.repository = repository

View file

@ -18,8 +18,8 @@ class Md5sum:
""" Checksum the sources. """
def __init__(self, flags: list):
__slots__ = 'flags'
self.flags: list = flags
self.ascii = Ascii()
self.errors = Errors()
self.utils = Utilities()

View file

@ -18,7 +18,6 @@ class Cleanings(Configs):
""" Cleans the logs from packages. """
def __init__(self, flags: list):
__slots__ = 'flags'
super(Configs, self).__init__()
self.flags: list = flags
self.session = Session

View file

@ -12,7 +12,6 @@ class Dependees(Configs):
""" Show which packages depend. """
def __init__(self, data: dict, packages: list, flags: list, repository: str):
__slots__ = 'data', 'packages', 'flags'
super(Configs, self).__init__()
self.data: dict = data
self.packages: list = packages

View file

@ -17,10 +17,10 @@ class Download(Configs):
""" Download the slackbuilds with the sources only. """
def __init__(self, directory: Path, flags: list, repository: str):
__slots__ = 'directory', 'flags'
super(Configs, self).__init__()
self.directory: Path = directory
self.flags: list = flags
self.repository: str = repository
self.repos = Repositories()
self.utils = Utilities()
@ -35,7 +35,7 @@ class Download(Configs):
""" Download the package only. """
packages: list = self.utils.apply_package_pattern(data, packages)
view = ViewMessage(self.flags, data)
view = ViewMessage(self.flags, self.repository, data)
view.download_packages(packages, self.directory)
view.question()

View file

@ -15,7 +15,6 @@ from slpkg.error_messages import Errors
class Downloader(Configs):
def __init__(self, path: Union[str, Path], urls: list, flags: list):
__slots__ = 'path', 'urls', 'flags'
super(Configs, self).__init__()
self.path: Path = path
self.urls: list = urls

View file

@ -12,7 +12,6 @@ class LoggingDeps:
""" Logging installed dependencies. """
def __init__(self, repository: str, data: dict):
__slots__ = 'repository', 'data'
self.data: dict = data
self.utils = Utilities()

View file

@ -37,7 +37,6 @@ from slpkg.update_repository import UpdateRepository
class Argparse(Configs):
def __init__(self, args: list):
__slots__ = 'args'
super(Configs).__init__()
self.args: list = args
self.flags: list = []

View file

@ -12,7 +12,6 @@ from pathlib import Path
class NewConfigs:
def __init__(self, options: list):
__slots__ = 'options'
self.options: list = options
self.etc_path: Path = Path('/etc/slpkg')
self.slpkg_config: Path = Path(self.etc_path, 'slpkg.toml')

View file

@ -17,7 +17,6 @@ class RemovePackages(Configs):
""" Removes installed packages. """
def __init__(self, packages: list, flags: list):
__slots__ = 'packages', 'flags'
super(Configs, self).__init__()
self.packages: list = packages
self.flags: list = flags

View file

@ -7,9 +7,9 @@ from typing import Generator
class Requires:
""" Creates a list of dependencies with
the right order to install. """
__slots__ = ('data', 'name')
def __init__(self, data: dict, name: str):
__slots__ = 'data', 'name'
self.data: dict = data
self.name: str = name

View file

@ -12,7 +12,6 @@ class SBoQueries(Configs):
""" Queries class for the sbo repository. """
def __init__(self, repository: str):
__slots__ = 'repository'
super(Configs, self).__init__()
self.session = Session

View file

@ -31,7 +31,6 @@ class Slackbuilds(Configs):
""" Download build and install the SlackBuilds. """
def __init__(self, repository: str, data: dict, slackbuilds: list, flags: list, mode: str):
__slots__ = 'repository', 'data', 'slackbuilds', 'flags', 'mode'
super(Configs, self).__init__()
self.data = data
self.slackbuilds: list = slackbuilds

View file

@ -11,7 +11,6 @@ class SearchPackage(Configs):
""" Search packages from the repositories. """
def __init__(self, repository: str):
__slots__ = 'repository'
super(Configs, self).__init__()
self.utils = Utilities()

View file

@ -10,7 +10,6 @@ class Tracking(Configs):
""" Tracking of the package dependencies. """
def __init__(self, flags: list, repository: str):
__slots__ = 'flags', 'repository'
super(Configs, self).__init__()
self.flags: list = flags

View file

@ -21,7 +21,6 @@ class UpdateRepository(Configs):
""" Deletes and install the data. """
def __init__(self, flags: list, repository: str):
__slots__ = 'flags', 'repository'
super(Configs, self).__init__()
self.flags: list = flags
self.repository: str = repository

View file

@ -15,7 +15,6 @@ class Upgrade(Configs):
""" Upgrade the installed packages. """
def __init__(self, repository: str, data: dict):
__slots__ = 'repository', 'data'
super(Configs, self).__init__()
self.repository = repository
self.data: dict = data

View file

@ -7,7 +7,6 @@ from slpkg.configs import Configs
class Help(Configs):
def __init__(self, command: str, flags: list):
__slots__ = 'command', 'flags'
super(Configs, self).__init__()
self.command: str = command
self.flags: list = flags

View file

@ -15,7 +15,6 @@ class ViewPackage(Configs):
""" View the repository packages. """
def __init__(self, flags: list):
__slots__ = 'flags'
super(Configs, self).__init__()
self.flags: list = flags

View file

@ -19,7 +19,6 @@ from slpkg.models.models import session as Session
class ViewMessage(Configs):
def __init__(self, flags: list, repository: str, data=None):
__slots__ = 'flags', 'data'
super(Configs, self).__init__()
self.flags: list = flags
self.repository = repository