Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2023-01-06 23:06:54 +02:00
commit 83f44ffdb9
11 changed files with 51 additions and 53 deletions

View file

@ -1,3 +1,11 @@
4.4.6 - 06/01/2023
Updated:
- Improve speed for dependees
Fixed:
- summary for build
Remove:
- python-toml dependency
4.4.5 - 03/01/2023
Added:
- New modern view mode style

View file

@ -23,7 +23,6 @@ Requirements
SQLAlchemy >= 1.4.36
pythondialog >= 3.5.3
progress >= 1.6
toml >= 0.10.2
Install
-------
@ -32,8 +31,8 @@ Install from the official third-party `SBo repository <https://slackbuilds.org/r
.. code-block:: bash
$ tar xvf slpkg-4.4.5.tar.gz
$ cd slpkg-4.4.5
$ tar xvf slpkg-4.4.6.tar.gz
$ cd slpkg-4.4.6
$ ./install.sh
Screenshots

View file

@ -1,4 +1,3 @@
SQLAlchemy >= 1.4.46
pythondialog >= 3.5.3
progress >= 1.6
toml >= 0.10.2
progress >= 1.6

View file

@ -1,6 +1,6 @@
[metadata]
name = slpkg
version = 4.4.5
version = 4.4.6
license_file = LICENSE
author = Dimitris Zlatanidis
author_email = d.zlatanidis@gmail.com
@ -41,7 +41,6 @@ install_requires =
SQLAlchemy >= 1.4.36
pythondialog >= 3.5.3
progress >= 1.6
toml >= 0.10.2
include_package_data = True
[options.packages.find]

View file

@ -1,11 +1,10 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from progress.spinner import PixelSpinner
from slpkg.configs import Configs
from slpkg.views.ascii import Ascii
from slpkg.queries import SBoQueries
from slpkg.models.models import SBoTable
from slpkg.models.models import session as Session
class Dependees:
@ -15,19 +14,19 @@ class Dependees:
self.packages = packages
self.flags = flags
self.configs = Configs
self.session = Session
self.ascii = Ascii()
self.llc = self.ascii.lower_left_corner
self.hl = self.ascii.horizontal_line
self.var = self.ascii.vertical_and_right
self.colors = self.configs.colour
self.colors = self.configs.colour
self.color = self.colors()
self.bold = self.color['bold']
self.violet = self.color['violet']
self.cyan = self.color['cyan']
self.grey = self.color['grey']
self.yellow = self.color['yellow']
self.bviolet = f'{self.bold}{self.violet}'
self.byellow = f'{self.bold}{self.yellow}'
self.endc = self.color['endc']
def slackbuilds(self):
@ -35,40 +34,30 @@ class Dependees:
print(f"The list below shows the "
f"packages that dependees on '{', '.join([p for p in self.packages])}':\n")
dependees = {}
spinner = PixelSpinner(f'{self.endc}Collecting the data... {self.bviolet}')
for package in self.packages:
found = [] # Reset list every package
sbos = SBoQueries('').sbos()
for pkg in self.packages:
dependees = list(self.find_requires(pkg))
print(f'{self.byellow}{pkg}{self.endc}')
print(f' {self.llc}{self.hl}', end='')
if not dependees:
print(f'{self.cyan}No dependees{self.endc}')
for sbo in sbos:
requires = SBoQueries(sbo).requires()
spinner.next()
sp = ' ' * 4
for i, dep in enumerate(dependees, start=1):
if i == 1:
print(f' {self.cyan}{dep[0]}{self.endc}')
else:
print(f'{sp}{self.cyan}{dep[0]}{self.endc}')
if package in requires:
found.append(sbo)
dependees[package] = found
last = f' {self.llc}{self.hl}'
print('\n')
if dependees:
for key, value in dependees.items():
print(f'{self.yellow}{key}{self.endc}')
print(end=f'\r{last}')
char = f' {self.var}{self.hl}'
for i, v in enumerate(value, start=1):
if i == len(value):
char = last
if i == 1:
print(f'{self.cyan}{v}{self.endc}')
if '--full-reverse' in self.flags:
if i == len(dependees):
print(" " * 4 + f' {self.llc}{self.hl} {self.violet}{dep[1]}{self.endc}')
else:
print(f'{" " * 3}{self.cyan}{v}{self.endc}')
print(" " * 4 + f' {self.var}{self.hl} {self.violet}{dep[1]}{self.endc}')
print(f'\n{self.grey}{len(dependees)} dependees for {pkg}{self.endc}\n')
if '--full-reverse' in self.flags:
print(f'{" " * 4}{char} {" ".join([req for req in SBoQueries(v).requires()])}')
print(f'\n{self.grey}{len(value)} dependees for {key}{self.endc}\n')
else:
print(f'{self.endc}No dependees found.\n')
def find_requires(self, sbo):
""" Find requires that slackbuild dependees. """
requires = self.session.query(SBoTable.name, SBoTable.requires).all()
for req in requires:
if [r for r in req[1].split() if r == sbo]:
yield req

View file

@ -20,8 +20,10 @@ class Downloader:
self.configs = Configs
self.colors = self.configs.colour
self.color = self.colors()
self.bold = self.color['bold']
self.green = self.color['green']
self.yellow = self.color['yellow']
self.byellow = f'{self.bold}{self.yellow}'
self.endc = self.color['endc']
self.progress = ProgressBar()
self.stderr = None
@ -52,7 +54,7 @@ class Downloader:
# Terminate process 2 if process 1 finished
if not p1.is_alive():
print(f'{self.endc}{self.yellow} Done{self.endc}', end='')
print(f'{self.endc}{self.byellow} Done{self.endc}', end='')
p2.terminate()
# Wait until process 2 finish

View file

@ -23,7 +23,9 @@ class RemovePackages:
self.configs = Configs
self.colors = self.configs.colour
self.color = self.colors()
self.bold = self.color['bold']
self.yellow = self.color['yellow']
self.byellow = f'{self.bold}{self.yellow}'
self.red = self.color['red']
self.endc = self.color['endc']
self.installed_packages = []
@ -93,7 +95,7 @@ class RemovePackages:
# Terminate process 2 if process 1 finished
if not p1.is_alive():
print(f'{self.endc}{self.yellow} Done{self.endc}', end='')
print(f'{self.endc}{self.byellow} Done{self.endc}', end='')
p2.terminate()
# Wait until process 2 finish

View file

@ -37,9 +37,11 @@ class Slackbuilds:
self.configs = Configs
self.colors = self.configs.colour
self.color = self.colors()
self.bold = self.color['bold']
self.cyan = self.color['cyan']
self.red = self.color['red']
self.yellow = self.color['yellow']
self.byellow = f'{self.bold}{self.yellow}'
self.endc = self.color['endc']
self.install_order = []
self.dependencies = []
@ -299,7 +301,7 @@ class Slackbuilds:
# Terminate process 2 if process 1 finished
if not p1.is_alive():
print(f'{self.endc}{self.yellow} Done{self.endc}', end='')
print(f'{self.endc}{self.byellow} Done{self.endc}', end='')
p2.terminate()
# Wait until process 2 finish

View file

@ -5,7 +5,7 @@ class Version:
""" Print the version. """
def __init__(self):
self.version_info = (4, 4, 5)
self.version_info = (4, 4, 6)
self.version = '{0}.{1}.{2}'.format(*self.version_info)
self.license = 'MIT License'
self.author = 'Dimitris Zlatanidis (dslackw)'

View file

@ -4,8 +4,8 @@
import urllib3
from slpkg.configs import Configs
from slpkg.models.models import SBoTable
from slpkg.queries import SBoQueries
from slpkg.models.models import SBoTable
from slpkg.models.models import session as Session

View file

@ -231,8 +231,6 @@ class ViewMessage:
upgrade += 1
elif installed and option == 'remove':
remove += 1
else:
build += 1
self.draw_bottom_line()
@ -241,7 +239,7 @@ class ViewMessage:
f'installed and {upgrade} will be upgraded.{self.endc}')
elif option == 'build':
print(f'{self.grey}Total {build} packages '
print(f'{self.grey}Total {len(slackbuilds)} packages '
f'will be build in {self.configs.tmp_path} folder.{self.endc}')
elif option == 'remove':