From a27f3f3002bc7d3feb25f5a801319e79ae672581 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 29 Oct 2014 21:28:39 +0200 Subject: [PATCH] updated for version 2.0.3 --- CHANGELOG | 8 ++++++++ README.rst | 8 ++++---- install.sh | 2 +- slackbuild/slpkg.SlackBuild | 2 +- slackbuild/slpkg.info | 4 ++-- slpkg/__metadata__.py | 5 ++--- slpkg/main.py | 2 +- slpkg/messages.py | 27 +-------------------------- slpkg/pkg/manager.py | 12 +++++++----- slpkg/sbo/views.py | 31 ++++++++++++++++++++++++++++--- slpkg/slack/install.py | 7 ++++--- slpkg/slack/patches.py | 7 ++++--- slpkg/slack/sizes.py | 2 +- 13 files changed, 64 insertions(+), 53 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0c14e149..391c3c17 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +Version 2.0.3 +29-10-2014 + +[Updated] - Fix arguments. + - Fix dpenedencies log. + - Fix pydoc pager. + - Fix list packaging paging. + Version 2.0.2 21-10-2014 diff --git a/README.rst b/README.rst index 5fa339a6..61ce3415 100644 --- a/README.rst +++ b/README.rst @@ -11,9 +11,9 @@ Latest Release: -- Version: 2.0.2 +- Version: 2.0.3 - `Package `_ -- `Source `_ +- `Source `_ - `CHANGELOG `_ .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png @@ -100,8 +100,8 @@ Untar the archive and run install.sh script: .. code-block:: bash - $ tar xvf slpkg-2.0.2.tar.gz - $ cd slpkg-2.0.2 + $ tar xvf slpkg-2.0.3.tar.gz + $ cd slpkg-2.0.3 $ ./install.sh Using `pip `_ : diff --git a/install.sh b/install.sh index 8c14c9b5..57b4de75 100755 --- a/install.sh +++ b/install.sh @@ -21,7 +21,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=slpkg -VERSION=${VERSION:-2.0.2} +VERSION=${VERSION:-2.0.3} TAG=${TAG:-_dsw} cd .. diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 09a5c51e..3e04eeb0 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=slpkg -VERSION=${VERSION:-2.0.2} +VERSION=${VERSION:-2.0.3} BUILD=${BUILD:-1} TAG=${TAG:-_dsw} diff --git a/slackbuild/slpkg.info b/slackbuild/slpkg.info index 3d2ea8c1..d41f54fe 100644 --- a/slackbuild/slpkg.info +++ b/slackbuild/slpkg.info @@ -1,7 +1,7 @@ PRGNAM="slpkg" -VERSION="2.0.1" +VERSION="2.0.3" HOMEPAGE="https://github.com/dslackw/slpkg" -DOWNLOAD="https://github.com/dslackw/slpkg/archive/v2.0.2.tar.gz" +DOWNLOAD="https://github.com/dslackw/slpkg/archive/v2.0.3.tar.gz" MD5SUM="" DOWNLOAD_x86_64="" MD5SUM_x86_64="" diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index a0fb56a3..7b9c4e66 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -22,11 +22,10 @@ # along with this program. If not, see . import os -import subprocess __all__ = "slpkg" __author__ = "dslackw" -__version_info__ = (2, 0, 2) +__version_info__ = (2, 0, 3) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com" @@ -35,7 +34,7 @@ __email__ = "d.zlatanidis@gmail.com" sp = "-" ''' current path ''' -path = subprocess.check_output(["pwd"], shell=True).replace("\n", "/") +path = os.getcwd() + "/" ''' build path ''' build_path = path + "slpkg_Build/" diff --git a/slpkg/main.py b/slpkg/main.py index 4a5ddb7f..657ab8d6 100755 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -26,9 +26,9 @@ import getpass from queue import QueuePkgs from messages import s_user +from __metadata__ import path from blacklist import BlackList from version import prog_version -from __metadata__ import path from arguments import options, usage from pkg.build import BuildPackage diff --git a/slpkg/messages.py b/slpkg/messages.py index 542dd97c..c48cbdfc 100755 --- a/slpkg/messages.py +++ b/slpkg/messages.py @@ -22,7 +22,7 @@ # along with this program. If not, see . import sys -from colors import RED, GREEN, CYAN, YELLOW, ENDC +from colors import RED, CYAN, ENDC def pkg_not_found(bol, pkg, message, eol): @@ -74,28 +74,3 @@ def template(max_len): Print template ''' print("+" + "=" * max_len) - - -def view_sbo(*args): - ''' - View slackbuild.org - ''' - print # new line at start - template(78) - print("| {0}Package {1}{2}{3} --> {4}".format(GREEN, CYAN, args[0], GREEN, - ENDC + args[1])) - template(78) - print("| {0}Description : {1}{2}".format(GREEN, ENDC, args[2])) - print("| {0}SlackBuild : {1}{2}".format(GREEN, ENDC, args[3])) - print("| {0}Sources : {1}{2}".format(GREEN, ENDC, args[4])) - print("| {0}Requirements : {1}{2}".format(YELLOW, ENDC, ", ".join(args[5]))) - template(78) - print(" {0}R{1}EADME View the README file".format(RED, ENDC)) - print(" {0}S{1}lackBuild View the SlackBuild file".format( - RED, ENDC)) - print(" In{0}f{1}o View the Info file".format(RED, ENDC)) - print(" {0}D{1}ownload Download this package".format(RED, ENDC)) - print(" {0}B{1}uild Download and build".format(RED, ENDC)) - print(" {0}I{1}nstall Download/Build/Install".format( - RED, ENDC)) - print(" {0}Q{1}uit Quit\n".format(RED, ENDC)) diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index bdcc2b78..96299906 100755 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -266,7 +266,8 @@ class PackageManager(object): ''' List with the installed packages ''' - space = (" " * 9) + tty_size = os.popen('stty size', 'r').read().split() + row = int(tty_size[0]) - 2 try: if "sbo" in pattern: search = "_SBo" @@ -276,15 +277,16 @@ class PackageManager(object): search = "-noarch-" elif "all" in pattern: search = "" - index, page = 0, 50 + index, page = 0, row for pkg in find_package("", pkg_path): if search in pkg: index += 1 print("{0}{1}:{2} {3}".format(GREY, index, ENDC, pkg)) if index == page: - raw_input("{0}-- {1}More{2} --".format(space, CYAN, - ENDC)) - page += 50 + raw_input("\nPress {0}Enter{1} to continue...".format( + CYAN, ENDC)) + print # new line after page + page += row print # new line at end except KeyboardInterrupt: print # new line at exit diff --git a/slpkg/sbo/views.py b/slpkg/sbo/views.py index 61ad897a..9c76d633 100755 --- a/slpkg/sbo/views.py +++ b/slpkg/sbo/views.py @@ -27,10 +27,10 @@ import pydoc from init import initialization from downloader import Download -from colors import RED, GREEN, GREY, ENDC from __metadata__ import tmp, build_path, pkg_path, sp -from messages import (pkg_found, view_sbo, pkg_not_found, - template, build_FAILED) +from colors import RED, GREEN, GREY, CYAN, YELLOW, ENDC +from messages import (pkg_found, pkg_not_found, template, + build_FAILED) from pkg.find import find_package from pkg.build import BuildPackage @@ -108,6 +108,31 @@ class SBoNetwork(object): pkg_not_found("\n", self.name, "Can't view", "\n") +def view_sbo(*args): + ''' + View slackbuild.org + ''' + print # new line at start + template(78) + print("| {0}Package {1}{2}{3} --> {4}".format(GREEN, CYAN, args[0], GREEN, + ENDC + args[1])) + template(78) + print("| {0}Description : {1}{2}".format(GREEN, ENDC, args[2])) + print("| {0}SlackBuild : {1}{2}".format(GREEN, ENDC, args[3])) + print("| {0}Sources : {1}{2}".format(GREEN, ENDC, args[4])) + print("| {0}Requirements : {1}{2}".format(YELLOW, ENDC, ", ".join(args[5]))) + template(78) + print(" {0}R{1}EADME View the README file".format(RED, ENDC)) + print(" {0}S{1}lackBuild View the SlackBuild file".format( + RED, ENDC)) + print(" In{0}f{1}o View the Info file".format(RED, ENDC)) + print(" {0}D{1}ownload Download this package".format(RED, ENDC)) + print(" {0}B{1}uild Download and build".format(RED, ENDC)) + print(" {0}I{1}nstall Download/Build/Install".format( + RED, ENDC)) + print(" {0}Q{1}uit Quit\n".format(RED, ENDC)) + + def fill_pager(page): ''' Fix pager spaces diff --git a/slpkg/slack/install.py b/slpkg/slack/install.py index 76254e50..b545adc8 100755 --- a/slpkg/slack/install.py +++ b/slpkg/slack/install.py @@ -55,9 +55,10 @@ class Slack(object): os.mkdir(slpkg_tmp) if not os.path.exists(self.tmp_path): os.mkdir(self.tmp_path) - PACKAGES = URL.read(mirrors("PACKAGES.TXT", "", self.version)) - EXTRA = URL.read(mirrors("PACKAGES.TXT", "extra/", self.version)) - PASTURE = URL.read(mirrors("PACKAGES.TXT", "pasture/", self.version)) + PACKAGES = URL(mirrors("PACKAGES.TXT", "", self.version)).reading() + EXTRA = URL(mirrors("PACKAGES.TXT", "extra/", self.version)).reading() + PASTURE = URL(mirrors("PACKAGES.TXT", "pasture/", + self.version)).reading() self.PACKAGES_TXT = PACKAGES + EXTRA + PASTURE def start(self): diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 864e62bb..98a0c4d7 100755 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -54,11 +54,12 @@ class Patches(object): if not os.path.exists(self.patch_path): os.mkdir(self.patch_path) if version == "stable": - self.PACKAGES_TXT = URL.read(mirrors("PACKAGES.TXT", "patches/", - version)) + self.PACKAGES_TXT = URL(mirrors("PACKAGES.TXT", "patches/", + version)).reading() self.step = 100 else: - self.PACKAGES_TXT = URL.read(mirrors("PACKAGES.TXT", "", version)) + self.PACKAGES_TXT = URL(mirrors("PACKAGES.TXT", "", + version)).reading() self.step = 700 def start(self): diff --git a/slpkg/slack/sizes.py b/slpkg/slack/sizes.py index b1d9d793..a99b5972 100755 --- a/slpkg/slack/sizes.py +++ b/slpkg/slack/sizes.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# units.py file is part of slpkg. +# sizes.py file is part of slpkg. # Copyright 2014 Dimitris Zlatanidis # All rights reserved.