Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2019-12-08 19:46:10 +01:00
commit ac99c027cd
44 changed files with 68 additions and 67 deletions

View file

@ -74,7 +74,7 @@ def select_slack_release(slack_rel):
return slack_rel
class MetaData(object):
class MetaData:
__all__ = "slpkg"
__author__ = "dslackw"

View file

@ -30,7 +30,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.pkg.manager import PackageManager
class Auto(object):
class Auto:
"""Select Slackware command to install packages
"""
def __init__(self, packages):

View file

@ -30,7 +30,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.binary.greps import Requires
class Dependencies(object):
class Dependencies:
"""Resolving binary dependencies
"""
def __init__(self, repo, black):

View file

@ -144,7 +144,7 @@ def ktown_filter(name, location, size, unsize):
return [fname, flocation, fsize, funsize]
class Requires(object):
class Requires:
def __init__(self, name, repo):
self.name = name

View file

@ -50,7 +50,7 @@ from slpkg.binary.dependency import Dependencies
from slpkg.slack.slack_version import slack_ver
class BinaryInstall(object):
class BinaryInstall:
"""Install binaries packages with all dependencies from
repository
"""

View file

@ -30,7 +30,7 @@ from slpkg.slack.mirrors import mirrors
from slpkg.slack.slack_version import slack_ver
class RepoInit(object):
class RepoInit:
"""Return PACKAGES.TXT and mirror by repository
"""
def __init__(self, repo):

View file

@ -29,7 +29,7 @@ from slpkg.splitting import split_package
from slpkg.__metadata__ import MetaData as _meta_
class BlackList(object):
class BlackList:
"""Blacklist class to add, remove or listed packages
in blacklist file."""
def __init__(self):

View file

@ -28,7 +28,7 @@ from slpkg.init import Initialization
from slpkg.__metadata__ import MetaData as _meta_
class Updates(object):
class Updates:
"""Checking for news in ChangeLog.txt
"""
def __init__(self, repo):

View file

@ -30,7 +30,7 @@ from slpkg.utils import Utils
from slpkg.__metadata__ import MetaData as _meta_
class Config(object):
class Config:
"""Print or edit slpkg configuration file
"""
def __init__(self):

View file

@ -29,7 +29,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.sbo.greps import SBoGrep
class PkgDesc(object):
class PkgDesc:
"""Print package description from the repository
"""
def __init__(self, name, repo, paint):

View file

@ -27,7 +27,7 @@ from __future__ import unicode_literals
import os
class DialogUtil(object):
class DialogUtil:
"""Create dialog checklist
"""
def __init__(self, *args):

View file

@ -32,7 +32,7 @@ from slpkg.slack.slack_version import slack_ver
from slpkg.__metadata__ import MetaData as _meta_
class Download(object):
class Download:
"""Downloader manager. Slpkg use wget by default but support
curl, aria2 and httpie
"""

View file

@ -26,7 +26,7 @@ import os
import requests
class FileSize(object):
class FileSize:
"""Check local or remote file size
"""
def __init__(self, registry):

View file

@ -26,7 +26,7 @@ import os
import subprocess
class Graph(object):
class Graph:
"""Drawing dependencies diagram
"""
def __init__(self, image):

View file

@ -30,7 +30,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.pkg.find import find_package
class PackageHealth(object):
class PackageHealth:
"""Health check installed packages
"""
def __init__(self, mode):

View file

@ -34,7 +34,7 @@ from slpkg.slack.mirrors import mirrors
from slpkg.slack.slack_version import slack_ver
class Initialization(object):
class Initialization:
"""Slpkg initialization start all from here. Create local
package lists and update or upgrade these.
"""

View file

@ -57,7 +57,7 @@ def library(repo):
return pkg_list
class Regex(object):
class Regex:
"""Grap packages with simple regex using asterisk *
with options: starts with string*
ends with *string

View file

@ -44,4 +44,3 @@ def write_deps(deps_dict):
with open(dep_path + name, "w") as f:
for dep in dependencies:
f.write(dep + "\n")
f.close()

View file

@ -66,7 +66,7 @@ from slpkg.binary.check import pkg_upgrade
from slpkg.binary.install import BinaryInstall
class ArgParse(object):
class ArgParse:
def __init__(self, args):
self.args = args

View file

@ -27,7 +27,7 @@ import itertools
from slpkg.__metadata__ import MetaData as _meta_
class Msg(object):
class Msg:
"""Messages control
"""
def __init__(self):
@ -70,22 +70,22 @@ class Msg(object):
"""Message checking
"""
print("{0}Checking...{1} ".format(self.meta.color["GREY"],
self.meta.color["ENDC"]), end="")
print(end="", flush=True)
self.meta.color["ENDC"]), end="",
flush=True)
def reading(self):
"""Message reading
"""
print("{0}Reading package lists...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"]), end="")
print(end="", flush=True)
self.meta.color["GREY"], self.meta.color["ENDC"]), end="",
flush=True)
def resolving(self):
"""Message resolving
"""
print("{0}Resolving dependencies...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"]), end="")
print(end="", flush=True)
self.meta.color["GREY"], self.meta.color["ENDC"]), end="",
flush=True)
def done(self):
"""Message done

View file

@ -31,7 +31,7 @@ from slpkg.utils import Utils
from slpkg.__metadata__ import MetaData as _meta_
class NewConfig(object):
class NewConfig:
"""Manage .new configuration files
"""
def __init__(self):
@ -187,15 +187,15 @@ class NewConfig(object):
diff1 = Utils().read_file(n[:-4]).splitlines()
if os.path.isfile(n):
diff2 = Utils().read_file(n).splitlines()
lines, l, c = [], 0, 0
lines, ln, c = [], 0, 0
for a, b in itertools.izip_longest(diff1, diff2):
l += 1
ln += 1
if a != b:
for s1, s2 in itertools.izip_longest(str(a), str(b)):
c += 1
if s1 != s2:
break
print("@@ -{0},{1} +{2},{3} @@\n".format(l, c, l, c))
print("@@ -{0},{1} +{2},{3} @@\n".format(ln, c, ln, c))
for line in lines[-3:]:
print("{0}".format(line))
if a is None:

View file

@ -39,7 +39,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.sbo.greps import SBoGrep
class BuildPackage(object):
class BuildPackage:
"""Build SBo packages from source
"""
def __init__(self, script, sources, path, auto):

View file

@ -28,7 +28,7 @@ from slpkg.splitting import split_package
from slpkg.__metadata__ import MetaData as _meta_
class GetFromInstalled(object):
class GetFromInstalled:
"""Find and return version and package name from
already installed packages
"""

View file

@ -39,7 +39,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.slack.slackware_repo import slackware_repository
class PackageManager(object):
class PackageManager:
"""Package manager class for install, upgrade,
reinstall, remove, find and display packages"""
def __init__(self, binary):

View file

@ -28,7 +28,7 @@ from slpkg.pkg.manager import PackageManager
from slpkg.__metadata__ import MetaData as _meta_
class FindFromRepos(object):
class FindFromRepos:
"""Find packages from all enabled repositories
"""
def __init__(self):
@ -53,7 +53,8 @@ class FindFromRepos(object):
Msg().template(78)
for repo in _meta_.repositories:
PACKAGES_TXT = PackageManager(pkg).list_lib(repo)
packages, sizes = PackageManager(pkg).list_greps(repo, PACKAGES_TXT)
packages, sizes = PackageManager(pkg).list_greps(repo,
PACKAGES_TXT)
for find, size in zip(packages, sizes):
for p in pkg:
if "--case-ins" in flag:

View file

@ -30,7 +30,7 @@ from slpkg.dialog_box import DialogUtil
from slpkg.__metadata__ import MetaData as _meta_
class RepoEnable(object):
class RepoEnable:
"""Read repositories.conf file and update with new enabled or
disabled repositories
"""

View file

@ -31,7 +31,7 @@ from slpkg.repolist import RepoList
from slpkg.__metadata__ import MetaData as _meta_
class RepoInfo(object):
class RepoInfo:
"""Repository information
"""
def __init__(self):
@ -78,8 +78,8 @@ class RepoInfo(object):
self.form["Number of packages:"] = data[0]
self.form["Status:"] = status
self.form["Last updated:"] = data[3]
elif (repo == "sbo" and os.path.isfile(self.meta.lib_path + "{0}_repo/"
"SLACKBUILDS.TXT".format(repo))):
elif (repo == "sbo" and os.path.isfile(
self.meta.lib_path + "{0}_repo/SLACKBUILDS.TXT".format(repo))):
status = "{0}enabled{1}".format(self.meta.color["GREEN"],
self.meta.color["ENDC"])
sum_sbo_pkgs = 0
@ -100,7 +100,8 @@ class RepoInfo(object):
self.form["Last updated:"] = last_upd
print()
for key, value in sorted(self.form.items()):
print(self.meta.color["GREY"] + key + self.meta.color["ENDC"], value)
print(self.meta.color["GREY"] + key + self.meta.color["ENDC"],
value)
print()
raise SystemExit()
@ -109,8 +110,8 @@ class RepoInfo(object):
Grap data packages
"""
sum_pkgs, size, unsize, last_upd = 0, [], [], ""
for line in (Utils().read_file(
self.meta.lib_path + repo + "_repo/PACKAGES.TXT").splitlines()):
f = self.meta.lib_path + repo + "_repo/PACKAGES.TXT"
for line in Utils().read_file(f).splitlines():
if line.startswith("PACKAGES.TXT;"):
last_upd = line[14:].strip()
if line.startswith("PACKAGE NAME:"):

View file

@ -27,7 +27,7 @@ from slpkg.repositories import Repo
from slpkg.__metadata__ import MetaData as _meta_
class RepoList(object):
class RepoList:
"""List of repositories
"""
def __init__(self):

View file

@ -28,7 +28,7 @@ from slpkg.utils import Utils
from slpkg.__metadata__ import MetaData as _meta_
class Repo(object):
class Repo:
"""Manage repositories configuration files
"""
def __init__(self):
@ -36,7 +36,8 @@ class Repo(object):
self.DEFAULT_REPOS_NAMES = self.meta.default_repositories
self.custom_repo_file = "/etc/slpkg/custom-repositories"
self.default_repo_file = "/etc/slpkg/default-repositories"
self.custom_repositories_list = Utils().read_file(self.custom_repo_file)
self.custom_repositories_list = Utils().read_file(
self.custom_repo_file)
self.default_repositories_list = Utils().read_file(
self.default_repo_file)
self.default_repository()
@ -62,9 +63,9 @@ class Repo(object):
"six (6) characters\n")
raise SystemExit()
with open(self.custom_repo_file, "a") as repos:
new_line = " {0}{1}{2}\n".format(repo, " " * (10 - len(repo)), url)
new_line = " {0}{1}{2}\n".format(repo, " " * (10 - len(repo)),
url)
repos.write(new_line)
repos.close()
print("\nRepository '{0}' successfully added\n".format(repo))
raise SystemExit()

View file

@ -29,7 +29,7 @@ from slpkg.pkg.build import BuildPackage
from slpkg.sbo.greps import SBoGrep
class AutoBuild(object):
class AutoBuild:
"""Autobuild package if sources and script is already
downloaded
"""

View file

@ -29,7 +29,7 @@ from slpkg.url_read import URL
from slpkg.__metadata__ import MetaData as _meta_
class BuildNumber(object):
class BuildNumber:
"""Get build number from SlackBuild script
"""
def __init__(self, sbo_url, pkg):

View file

@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class SBoLink(object):
class SBoLink:
"""Create slackbuild tar.gz archive from url
"""
def __init__(self, sbo_url):

View file

@ -31,7 +31,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.sbo.greps import SBoGrep
class Requires(object):
class Requires:
"""Resolving SBo dependencies
"""
def __init__(self, flag):

View file

@ -26,7 +26,7 @@ from slpkg.utils import Utils
from slpkg.__metadata__ import MetaData as _meta_
class SBoGrep(object):
class SBoGrep:
"""Grab data from SLACKBUILDS.TXT file
"""
def __init__(self, name):

View file

@ -49,7 +49,7 @@ from slpkg.sbo.slack_find import slack_package
from slpkg.slack.slack_version import slack_ver
class SBoNetwork(object):
class SBoNetwork:
"""View SBo site in terminal and also read, build or
install packages
"""

View file

@ -39,7 +39,7 @@ from slpkg.sbo.search import sbo_search_pkg
from slpkg.sbo.slack_find import slack_package
class QueuePkgs(object):
class QueuePkgs:
"""Manage SBo packages, add or remove for building or
installation
"""

View file

@ -25,7 +25,7 @@
from slpkg.url_read import URL
class ReadSBo(object):
class ReadSBo:
"""Read SBo files from urls
"""
def __init__(self, sbo_url):

View file

@ -25,7 +25,7 @@
from slpkg.__metadata__ import MetaData as _meta_
class SBoArch(object):
class SBoArch:
"""Manage computer architecture for sbo repository
"""
def __init__(self):

View file

@ -49,7 +49,7 @@ from slpkg.sbo.search import sbo_search_pkg
from slpkg.sbo.slack_find import slack_package
class SBoInstall(object):
class SBoInstall:
"""Build and install SBo packages with all dependencies
"""
def __init__(self, slackbuilds, flag):

View file

@ -51,7 +51,7 @@ from slpkg.slack.mirrors import mirrors
from slpkg.slack.slack_version import slack_ver
class Patches(object):
class Patches:
"""Upgrade distribution from official Slackware mirrors
"""
def __init__(self, skip, flag):

View file

@ -34,7 +34,7 @@ from slpkg.__metadata__ import MetaData as _meta_
from slpkg.pkg.find import find_package
class DependenciesStatus(object):
class DependenciesStatus:
"""Print dependencies status used by packages
"""
def __init__(self, image):
@ -111,8 +111,7 @@ class DependenciesStatus(object):
for d in dep:
print("+-- {0}".format(d))
print("|")
print("\x1b[1A{0}\n".format(" "), end="")
print(end="", flush=True)
print("\x1b[1A{0}\n".format(" "), end="", flush=True)
self.summary()
if self.image:
Graph(self.image).dependencies(self.dmap)

View file

@ -38,7 +38,7 @@ from slpkg.binary.search import search_pkg
from slpkg.binary.dependency import Dependencies
class TrackingDeps(object):
class TrackingDeps:
"""View tree of dependencies and also
highlight packages with color green
if already installed and color red

View file

@ -27,7 +27,7 @@ import requests
from slpkg.__metadata__ import MetaData as _meta_
class URL(object):
class URL:
"""Urls reading class
"""
def __init__(self, link):

View file

@ -27,7 +27,7 @@ import os
from slpkg.splitting import split_package
class Utils(object):
class Utils:
"""Class with usefull utilities
"""
def case_sensitive(self, lst):