Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2019-12-01 11:44:34 +01:00
commit 488ba465b2
77 changed files with 169 additions and 183 deletions

View file

@ -1,3 +1,7 @@
3.7.0 - 1/12/2019
Updated:
- Switch to python3
3.4.3 - 19/05/2019 3.4.3 - 19/05/2019
Updated: Updated:
- Update gen_repos_files.sh to version 1.94 - Update gen_repos_files.sh to version 1.94

View file

@ -3,7 +3,7 @@
##### Python & OS Support ##### Python & OS Support
Slpkg works with Python versions 2.7.5+ . Slpkg works with Python versions 3.7+ .
Slpkg works on Slackware distribution and possibly in some Slackware based Slpkg works on Slackware distribution and possibly in some Slackware based
distribution like SalixOS, Slackel etc. distribution like SalixOS, Slackel etc.
@ -22,4 +22,4 @@ There are mainly 3 ways:
2. Download binary package from '`https://sourceforge.net/projects/slpkg/files/binary/`' 2. Download binary package from '`https://sourceforge.net/projects/slpkg/files/binary/`'
and use Slackware command '`upgradepkg --install-new <slpkg binary>`' and use Slackware command '`upgradepkg --install-new <slpkg binary>`'
3. Using pip: '`pip install https://gitlab.com/dslackw/slpkg/-/archive/3.4.3/slpkg-3.4.3.tar.gz`' 3. Using pip: '`pip install https://gitlab.com/dslackw/slpkg/-/archive/3.7.0/slpkg-3.7.0.tar.gz`'

View file

@ -1,9 +1 @@
Known issues: Known issues:
- Dialog utility crash in option --buildlist when move with arrows
sometimes without yet that create big issues.
Issues reference here:
https://sourceforge.net/p/pythondialog/bugs/6/
Upgrade dialog utility from here if only necessary:
https://gitlab.com/dslackw/SlackBuilds/tree/master/dialog

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slpkg file is part of slpkg. # slpkg file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# clean.py file is part of slpkg. # clean.py file is part of slpkg.

View file

@ -68,7 +68,7 @@ Remove custom repository by name.
.SS repo-enable, enable or disable repositories .SS repo-enable, enable or disable repositories
\fBslpkg\fP \fBrepo-enable\fP \fBslpkg\fP \fBrepo-enable\fP
.PP .PP
Enable or disable repositories via dialog utility (require python2-pythondialog) Enable or disable repositories via dialog utility (require python3-pythondialog)
.SS repo-list, repositories list .SS repo-list, repositories list
\fBslpkg\fP \fBrepo-list\fP \fBslpkg\fP \fBrepo-list\fP
@ -268,7 +268,7 @@ build or install etc. Use "--checklist" additional option to load all repository
.PP .PP
Additional options: Additional options:
.PP .PP
\fB--checklist\fP : Enable dialog utility and checklist option. (Require python2-pythondialog) \fB--checklist\fP : Enable dialog utility and checklist option. (Require python3-pythondialog)
.PP .PP
\fB--case-ins\fP : Search package name in repository with case insensitive. \fB--case-ins\fP : Search package name in repository with case insensitive.
@ -304,7 +304,7 @@ Additional options:
.PP .PP
\fB--tag\fP : Remove packages with by TAG. \fB--tag\fP : Remove packages with by TAG.
.PP .PP
\fB--checklist\fP : Enable dialog utility and checklist option. (Require python2-pythondialog) \fB--checklist\fP : Enable dialog utility and checklist option. (Require python3-pythondialog)
.PP .PP
\fB--third-party\fP : Remove all the third-party packages. (Be sure update the package lists before) \fB--third-party\fP : Remove all the third-party packages. (Be sure update the package lists before)

View file

@ -1,5 +1,5 @@
# Slackware Linux (based) # Slackware Linux (based)
# Python 2.7+ # Python 3.7+
# GNU wget # GNU wget
# GNU coreutils # GNU coreutils
# #
@ -9,4 +9,4 @@
# httpie (alternative downloader) # httpie (alternative downloader)
# pygraphviz >= 1.3.1 (drawing dependencies diagram) # pygraphviz >= 1.3.1 (drawing dependencies diagram)
# perl 5 language and graph-easy >= 0.75 (drawing dependencies ascii diagram) # perl 5 language and graph-easy >= 0.75 (drawing dependencies ascii diagram)
# python2-pythondialog >= 3.3.0 (Python interface to the UNIX dialog utility) # python3-pythondialog >= 3.3.0 (Python interface to the UNIX dialog utility)

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# setup.py file is part of slpkg. # setup.py file is part of slpkg.
@ -38,7 +38,7 @@ INSTALLATION_REQUIREMENTS = []
DOCS_REQUIREMENTS = [] DOCS_REQUIREMENTS = []
TESTS_REQUIREMENTS = [] TESTS_REQUIREMENTS = []
OPTIONAL_REQUIREMENTS = [ OPTIONAL_REQUIREMENTS = [
"python2-pythondialog >= 3.3.0", "python3-pythondialog >= 3.3.0",
"pygraphviz >= 1.3.1" "pygraphviz >= 1.3.1"
] ]
@ -86,9 +86,7 @@ setup(
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux", "Operating System :: POSIX :: Linux",
"Operating System :: Unix", "Operating System :: Unix",
"Programming Language :: Python", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Unix Shell", "Programming Language :: Unix Shell",
"Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Build Tools",
"Topic :: System :: Archiving :: Packaging", "Topic :: System :: Archiving :: Packaging",

View file

@ -5,7 +5,7 @@ to install packages. Slpkg makes it easier to maintain groups
of machines without having to manually update. of machines without having to manually update.
Optional dependencies: Optional dependencies:
python2-pythondialog (for dialog box interface) python3-pythondialog (for dialog box interface)
pygraphviz (for drawing dependencies diagram) pygraphviz (for drawing dependencies diagram)
graph-easy (for drawing ascii dependencies diagram) graph-easy (for drawing ascii dependencies diagram)
aria2 (alternative downloader) aria2 (alternative downloader)

View file

@ -63,9 +63,6 @@ fi
set -e set -e
PYTHON=python
# [ "${PYTHON3:-no}" = "yes" ] && PYTHON=python3
rm -rf $PKG rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT mkdir -p $TMP $PKG $OUTPUT
cd $TMP cd $TMP
@ -83,14 +80,7 @@ find -L . \
# skip pip installs # skip pip installs
sed -i 's/if "install"/if ""/' setup.py sed -i 's/if "install"/if ""/' setup.py
# Python 3 support temporarily is out until new Slackware version python3 setup.py install --root=$PKG
# will be release
# if [ "$PYTHON3" = "yes" ]; then
# sh convert-py3k
# cd py3k/$PRGNAM
#fi
$PYTHON setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# __metadata__.py file is part of slpkg. # __metadata__.py file is part of slpkg.
@ -78,7 +78,7 @@ class MetaData(object):
__all__ = "slpkg" __all__ = "slpkg"
__author__ = "dslackw" __author__ = "dslackw"
__version_info__ = (3, 4, 3) __version_info__ = (3, 7, 0)
__version__ = "{0}.{1}.{2}".format(*__version_info__) __version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# arguments.py file is part of slpkg. # arguments.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# auto_pkg.py file is part of slpkg. # auto_pkg.py file is part of slpkg.
@ -60,15 +60,15 @@ class Auto(object):
self.meta.color["ENDC"])) self.meta.color["ENDC"]))
self.msg.template(78) self.msg.template(78)
try: try:
self.choice = raw_input(" > ") self.choice = input(" > ")
except EOFError: except EOFError:
print("") print("")
raise SystemExit() raise SystemExit()
if self.choice in self.commands.keys(): if self.choice in self.commands.keys():
sys.stdout.write(" \x1b[1A{0}{1}{2}\n\n".format( print(" \x1b[1A{0}{1}{2}\n\n".format(
self.meta.color["CYAN"], self.commands[self.choice], self.meta.color["CYAN"], self.commands[self.choice],
self.meta.color["ENDC"])) self.meta.color["ENDC"]), end="")
sys.stdout.flush() print(end="", flush=True)
self.execute() self.execute()
def execute(self): def execute(self):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# check.py file is part of slpkg. # check.py file is part of slpkg.
@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from distutils.version import LooseVersion from pkg_resources import parse_version
from slpkg.messages import Msg from slpkg.messages import Msg
from slpkg.toolbar import status from slpkg.toolbar import status
@ -54,7 +54,7 @@ def pkg_upgrade(repo, skip, flag):
if name: # this tips because some pkg_name is empty if name: # this tips because some pkg_name is empty
repo_pkg = split_package(name[:-4]) repo_pkg = split_package(name[:-4])
if (repo_pkg[0] == inst_pkg[0] and if (repo_pkg[0] == inst_pkg[0] and
LooseVersion(repo_pkg[1]) > LooseVersion(inst_pkg[1]) and parse_version(repo_pkg[1]) > parse_version(inst_pkg[1]) and
repo_pkg[3] >= inst_pkg[3] and repo_pkg[3] >= inst_pkg[3] and
inst_pkg[0] not in skip and inst_pkg[0] not in skip and
repo_pkg[1] != "blacklist"): repo_pkg[1] != "blacklist"):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# dependency.py file is part of slpkg. # dependency.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# greps.py file is part of slpkg. # greps.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# install.py file is part of slpkg. # install.py file is part of slpkg.
@ -23,7 +23,7 @@
import os import os
from distutils.version import LooseVersion from pkg_resources import parse_version
from slpkg.utils import Utils from slpkg.utils import Utils
from slpkg.sizes import units from slpkg.sizes import units
@ -192,7 +192,7 @@ class BinaryInstall(object):
data_dict = Utils().case_sensitive(data) data_dict = Utils().case_sensitive(data)
for pkg in self.packages: for pkg in self.packages:
index = self.packages.index(pkg) index = self.packages.index(pkg)
for key, value in data_dict.iteritems(): for key, value in data_dict.items():
if key == pkg.lower(): if key == pkg.lower():
self.packages[index] = value self.packages[index] = value
@ -247,7 +247,7 @@ class BinaryInstall(object):
ins_ver = GetFromInstalled(name).version()[1:] ins_ver = GetFromInstalled(name).version()[1:]
if not ins_ver: if not ins_ver:
ins_ver = "0" ins_ver = "0"
if LooseVersion(rep_ver) < LooseVersion(ins_ver): if parse_version(rep_ver) < parse_version(ins_ver):
self.msg.template(78) self.msg.template(78)
print("| Package {0} don't downgrade, " print("| Package {0} don't downgrade, "
"setting by user".format(name)) "setting by user".format(name))
@ -308,7 +308,7 @@ class BinaryInstall(object):
" " * (18-len(pkg_repo[1])), pkg_repo[2], " " * (18-len(pkg_repo[1])), pkg_repo[2],
" " * (8-len(pkg_repo[2])), pkg_repo[3], " " * (8-len(pkg_repo[2])), pkg_repo[3],
" " * (7-len(pkg_repo[3])), repo, " " * (7-len(pkg_repo[3])), repo,
comp, " K")).rstrip() comp, " K").rstrip())
return [pkg_sum, upg_sum, uni_sum] return [pkg_sum, upg_sum, uni_sum]
def top_view(self): def top_view(self):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# repo_init.py file is part of slpkg. # repo_init.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# search.py file is part of slpkg. # search.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# blacklist.py file is part of slpkg. # blacklist.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# checks.py file is part of slpkg. # checks.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# checksum.py file is part of slpkg. # checksum.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# clean.py file is part of slpkg. # clean.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# config.py file is part of slpkg. # config.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# desc.py file is part of slpkg. # desc.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# dialog_box.py file is part of slpkg. # dialog_box.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# downloader.py file is part of slpkg. # downloader.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -* # -*- coding: utf-8 -*
# file_size.py file is part of slpkg. # file_size.py file is part of slpkg.
@ -23,7 +23,8 @@
import os import os
import urllib2 import urllib
from urllib.request import urlopen
class FileSize(object): class FileSize(object):
@ -36,10 +37,10 @@ class FileSize(object):
"""Returns the size of remote files """Returns the size of remote files
""" """
try: try:
tar = urllib2.urlopen(self.registry) tar = urlopen(self.registry)
meta = tar.info() meta = tar.info()
return int(meta.getheaders("Content-Length")[0]) return int(meta.get_all("Content-Length")[0])
except (urllib2.URLError, IndexError): except (urllib.error.URLError, IndexError):
return " " return " "
def local(self): def local(self):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# graph.py file is part of slpkg. # graph.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# grep_md5.py file is part of slpkg. # grep_md5.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# health.py file is part of slpkg. # health.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# init.py file is part of slpkg. # init.py file is part of slpkg.
@ -23,7 +23,6 @@
import os import os
import sys
import shutil import shutil
from slpkg.repositories import Repo from slpkg.repositories import Repo
@ -770,21 +769,21 @@ class Update(object):
for repo in enabled: for repo in enabled:
if check_for_local_repos(repo) is True: if check_for_local_repos(repo) is True:
continue continue
sys.stdout.write("{0}Check repository [{1}{2}{3}] ... " print("{0}Check repository [{1}{2}{3}] ... "
"{4}".format( "{4}".format(
self.meta.color["GREY"], self.meta.color["GREY"],
self.meta.color["CYAN"], repo, self.meta.color["CYAN"], repo,
self.meta.color["GREY"], self.meta.color["GREY"],
self.meta.color["ENDC"])) self.meta.color["ENDC"]), end="")
sys.stdout.flush() print(end="", flush=True)
if repo in default: if repo in default:
exec("{0}.{1}()".format(self._init, repo)) exec("{0}.{1}()".format(self._init, repo))
sys.stdout.write(self.done) print(self.done, end="")
elif repo in enabled: elif repo in enabled:
Initialization(False).custom(repo) Initialization(False).custom(repo)
sys.stdout.write(self.done) print(self.done, end="")
else: else:
sys.stdout.write(self.error) print(self.error, end="")
print("") # new line at end print("") # new line at end
raise SystemExit() raise SystemExit()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# load.py file is part of slpkg. # load.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# log_deps.py file is part of slpkg. # log_deps.py file is part of slpkg.
@ -33,7 +33,7 @@ def write_deps(deps_dict):
"""Write dependencies in a log file """Write dependencies in a log file
into directory `/var/log/slpkg/dep/` into directory `/var/log/slpkg/dep/`
""" """
for name, dependencies in deps_dict.iteritems(): for name, dependencies in deps_dict.items():
if find_package(name + _meta_.sp, _meta_.pkg_path): if find_package(name + _meta_.sp, _meta_.pkg_path):
dep_path = _meta_.log_path + "dep/" dep_path = _meta_.log_path + "dep/"
if not os.path.exists(dep_path): if not os.path.exists(dep_path):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# main.py file is part of slpkg. # main.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# md5sum.py file is part of slpkg. # md5sum.py file is part of slpkg.
@ -30,6 +30,6 @@ def md5(source):
""" """
# fix passing char '+' from source # fix passing char '+' from source
source = source.replace("%2B", "+") source = source.replace("%2B", "+")
with open(source) as file_to_check: with open(source, "rb") as file_to_check:
data = file_to_check.read() data = file_to_check.read()
return hashlib.md5(data).hexdigest() return hashlib.md5(data).hexdigest()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# messages.py file is part of slpkg. # messages.py file is part of slpkg.
@ -22,7 +22,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import itertools import itertools
from slpkg.__metadata__ import MetaData as _meta_ from slpkg.__metadata__ import MetaData as _meta_
@ -70,29 +69,29 @@ class Msg(object):
def checking(self): def checking(self):
"""Message checking """Message checking
""" """
sys.stdout.write("{0}Checking...{1} ".format(self.meta.color["GREY"], print("{0}Checking...{1} ".format(self.meta.color["GREY"],
self.meta.color["ENDC"])) self.meta.color["ENDC"]), end="")
sys.stdout.flush() print(end="", flush=True)
def reading(self): def reading(self):
"""Message reading """Message reading
""" """
sys.stdout.write("{0}Reading package lists...{1} ".format( print("{0}Reading package lists...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"])) self.meta.color["GREY"], self.meta.color["ENDC"]), end="")
sys.stdout.flush() print(end="", flush=True)
def resolving(self): def resolving(self):
"""Message resolving """Message resolving
""" """
sys.stdout.write("{0}Resolving dependencies...{1} ".format( print("{0}Resolving dependencies...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"])) self.meta.color["GREY"], self.meta.color["ENDC"]), end="")
sys.stdout.flush() print(end="", flush=True)
def done(self): def done(self):
"""Message done """Message done
""" """
sys.stdout.write("\b{0}Done{1}\n".format(self.meta.color["GREY"], print("\b{0}Done{1}\n".format(self.meta.color["GREY"],
self.meta.color["ENDC"])) self.meta.color["ENDC"]), end="")
def pkg(self, count): def pkg(self, count):
"""Print singular plural """Print singular plural
@ -125,7 +124,7 @@ class Msg(object):
answer = self.meta.default_answer answer = self.meta.default_answer
else: else:
try: try:
answer = raw_input("Would you like to continue [y/N]? ") answer = input("Would you like to continue [y/N]? ")
except EOFError: except EOFError:
print("") print("")
raise SystemExit() raise SystemExit()
@ -154,7 +153,7 @@ class Msg(object):
len(install), self.pkg(len(install)), len(install), self.pkg(len(install)),
len(upgrade), self.pkg(len(upgrade)))) len(upgrade), self.pkg(len(upgrade))))
self.template(78) self.template(78)
for installed, upgraded in itertools.izip_longest(install, upgrade): for installed, upgraded in itertools.zip_longest(install, upgrade):
if upgraded: if upgraded:
print("| Package {0} upgraded successfully".format(upgraded)) print("| Package {0} upgraded successfully".format(upgraded))
if installed: if installed:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# new_config.py file is part of slpkg. # new_config.py file is part of slpkg.
@ -88,7 +88,7 @@ class NewConfig(object):
print("| {0}Q{1}{2}uit from menu".format(self.red, self.endc, self.br)) print("| {0}Q{1}{2}uit from menu".format(self.red, self.endc, self.br))
self.msg.template(78) self.msg.template(78)
try: try:
choose = raw_input("\nWhat would you like to do [K/O/R/P/Q]? ") choose = input("\nWhat would you like to do [K/O/R/P/Q]? ")
except EOFError: except EOFError:
print("") print("")
raise SystemExit() raise SystemExit()
@ -141,7 +141,7 @@ class NewConfig(object):
"""Choose what do to file by file """Choose what do to file by file
""" """
print("") print("")
prompt_ask = raw_input("{0} [K/O/R/D/M/Q]? ".format(n)) prompt_ask = input("{0} [K/O/R/D/M/Q]? ".format(n))
print("") print("")
if prompt_ask in ("K", "k"): if prompt_ask in ("K", "k"):
self.keep() self.keep()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# build.py file is part of slpkg. # build.py file is part of slpkg.
@ -75,7 +75,7 @@ class BuildPackage(object):
try: try:
tar = tarfile.open(self.script) tar = tarfile.open(self.script)
except Exception as err: except Exception as err:
print err print(err)
raise SystemExit() raise SystemExit()
tar.extractall() tar.extractall()
tar.close() tar.close()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# find.py file is part of slpkg. # find.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -* # -*- coding: utf-8 -*
# installed.py file is part of slpkg. # installed.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# manager.py file is part of slpkg. # manager.py file is part of slpkg.
@ -108,7 +108,7 @@ class PackageManager(object):
if self.meta.default_answer in ["y", "Y"]: if self.meta.default_answer in ["y", "Y"]:
remove_pkg = self.meta.default_answer remove_pkg = self.meta.default_answer
else: else:
remove_pkg = raw_input( remove_pkg = input(
"\nAre you sure to remove {0} {1} [y/N]? ".format( "\nAre you sure to remove {0} {1} [y/N]? ".format(
str(len(self.removed)), msg)) str(len(self.removed)), msg))
except EOFError: except EOFError:
@ -144,7 +144,7 @@ class PackageManager(object):
remove_dep = self.meta.remove_deps_answer remove_dep = self.meta.remove_deps_answer
else: else:
try: try:
remove_dep = raw_input( remove_dep = input(
"\nRemove dependencies (maybe used by " "\nRemove dependencies (maybe used by "
"other packages) [y/N]? ") "other packages) [y/N]? ")
print("") print("")
@ -223,8 +223,8 @@ class PackageManager(object):
if "--third-party" in self.extra: if "--third-party" in self.extra:
print("\n") print("\n")
self.msg.template(78) self.msg.template(78)
print("| {0}{1}*** WARNING ***{2}").format( print(("| {0}{1}*** WARNING ***{2}").format(
" " * 27, self.meta.color["RED"], self.meta.color["ENDC"]) " " * 27, self.meta.color["RED"], self.meta.color["ENDC"]))
print("| Before you use third-party option, be sure you have" print("| Before you use third-party option, be sure you have"
" updated the packages \n| lists. Run the command" " updated the packages \n| lists. Run the command"
" 'slpkg update' and 'slpkg -c slack --upgrade'") " 'slpkg update' and 'slpkg -c slack --upgrade'")
@ -337,7 +337,7 @@ class PackageManager(object):
print("| Insert packages to exception remove:") print("| Insert packages to exception remove:")
self.msg.template(78) self.msg.template(78)
try: try:
self.skip = raw_input(" > ").split() self.skip = input(" > ").split()
except EOFError: except EOFError:
print("") print("")
raise SystemExit() raise SystemExit()
@ -519,7 +519,7 @@ class PackageManager(object):
self.meta.color["GREY"], index, self.meta.color["GREY"], index,
self.meta.color["ENDC"], pkg)) self.meta.color["ENDC"], pkg))
if index == page: if index == page:
read = raw_input("\nPress {0}Enter{1} to " read = input("\nPress {0}Enter{1} to "
"continue... ".format( "continue... ".format(
self.meta.color["CYAN"], self.meta.color["CYAN"],
self.meta.color["ENDC"])) self.meta.color["ENDC"]))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# pkg_find.py file is part of slpkg. # pkg_find.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# remove.py file is part of slpkg. # remove.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# repoenable.py file is part of slpkg. # repoenable.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# repoinfo.py file is part of slpkg. # repoinfo.py file is part of slpkg.
@ -99,8 +99,8 @@ class RepoInfo(object):
self.form["Status:"] = status self.form["Status:"] = status
self.form["Last updated:"] = last_upd self.form["Last updated:"] = last_upd
print("") print("")
for key, value in sorted(self.form.iteritems()): 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("") print("")
raise SystemExit() raise SystemExit()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# repolist.py file is part of slpkg. # repolist.py file is part of slpkg.
@ -49,7 +49,7 @@ class RepoList(object):
"Default", " " * 3, "Default", " " * 3,
"Status")) "Status"))
self.msg.template(78) self.msg.template(78)
for repo_id, repo_URL in sorted(self.all_repos.iteritems()): for repo_id, repo_URL in sorted(self.all_repos.items()):
status, COLOR = "disabled", self.meta.color["RED"] status, COLOR = "disabled", self.meta.color["RED"]
default = "yes" default = "yes"
if len(repo_URL) > 49: if len(repo_URL) > 49:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# repositories.py file is part of slpkg. # repositories.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# autobuild.py file is part of slpkg. # autobuild.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# build_num.py file is part of slpkg. # build_num.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# check.py file is part of slpkg. # check.py file is part of slpkg.
@ -23,7 +23,7 @@
import os import os
from distutils.version import LooseVersion from pkg_resources import parse_version
from slpkg.messages import Msg from slpkg.messages import Msg
from slpkg.toolbar import status from slpkg.toolbar import status
@ -49,7 +49,7 @@ def sbo_upgrade(skip, flag):
if (name in data and name not in skip and name not in blacklist): if (name in data and name not in skip and name not in blacklist):
sbo_package = ("{0}-{1}".format(name, SBoGrep(name).version())) sbo_package = ("{0}-{1}".format(name, SBoGrep(name).version()))
package = ("{0}-{1}".format(name, ver)) package = ("{0}-{1}".format(name, ver))
if LooseVersion(sbo_package) > LooseVersion(package): if parse_version(sbo_package) > parse_version(package):
upgrade_names.append(name) upgrade_names.append(name)
Msg().done() Msg().done()
if "--checklist" in flag: if "--checklist" in flag:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# download.py file is part of slpkg. # download.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# dependency.py file is part of slpkg. # dependency.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# greps.py file is part of slpkg. # greps.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# network.py file is part of slpkg. # network.py file is part of slpkg.
@ -137,7 +137,7 @@ class SBoNetwork(object):
""" """
if "--case-ins" in self.flag: if "--case-ins" in self.flag:
data_dict = Utils().case_sensitive(self.data) data_dict = Utils().case_sensitive(self.data)
for key, value in data_dict.iteritems(): for key, value in data_dict.items():
if key == self.name.lower(): if key == self.name.lower():
self.name = value self.name = value
@ -171,16 +171,16 @@ class SBoNetwork(object):
} }
try: try:
message = " Choose an option > " message = " Choose an option > "
self.choice = raw_input("{0}{1}{2}".format(self.grey, message, self.choice = input("{0}{1}{2}".format(self.grey, message,
self.endc)) self.endc))
except EOFError: except EOFError:
print("") print("")
raise SystemExit() raise SystemExit()
try: try:
sys.stdout.write("{0}\x1b[1A{1}{2}{3}\n".format( print("{0}\x1b[1A{1}{2}{3}\n".format(
" " * len(message), self.cyan, commands[self.choice], " " * len(message), self.cyan, commands[self.choice],
self.endc)) self.endc), end="")
sys.stdout.flush() print(end="", flush=True)
except KeyError: except KeyError:
pass pass

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# queue.py file is part of slpkg. # queue.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# read.py file is part of slpkg. # read.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# sbo_arch.py file is part of slpkg. # sbo_arch.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# search.py file is part of slpkg. # search.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slack_find.py file is part of slpkg. # slack_find.py file is part of slpkg.
@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from distutils.version import LooseVersion from pkg_resources import parse_version
from slpkg.messages import Msg from slpkg.messages import Msg
from slpkg.__metadata__ import MetaData as _meta_ from slpkg.__metadata__ import MetaData as _meta_
@ -38,7 +38,8 @@ def slack_package(prgnam):
if pkg.startswith(prgnam) and pkg[:-4].endswith("_SBo"): if pkg.startswith(prgnam) and pkg[:-4].endswith("_SBo"):
binaries.append(pkg) binaries.append(pkg)
for bins in binaries: for bins in binaries:
if LooseVersion(bins) > LooseVersion(cache): binary = bins
if parse_version(bins) > parse_version(cache):
binary = bins binary = bins
cache = binary cache = binary
if not binary: if not binary:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slackbuild.py file is part of slpkg. # slackbuild.py file is part of slpkg.
@ -23,7 +23,7 @@
import os import os
from distutils.version import LooseVersion from pkg_resources import parse_version
from slpkg.utils import Utils from slpkg.utils import Utils
@ -171,7 +171,7 @@ class SBoInstall(object):
data_dict = Utils().case_sensitive(self.data) data_dict = Utils().case_sensitive(self.data)
for name in self.slackbuilds: for name in self.slackbuilds:
index = self.slackbuilds.index(name) index = self.slackbuilds.index(name)
for key, value in data_dict.iteritems(): for key, value in data_dict.items():
if key == name.lower(): if key == name.lower():
self.slackbuilds[index] = value self.slackbuilds[index] = value
@ -272,7 +272,7 @@ class SBoInstall(object):
" " * (23-len(args[1] + ver)), args[2], " " * (23-len(args[1] + ver)), args[2],
" " * (18-len(args[2])), args[3], " " * (18-len(args[2])), args[3],
" " * (15-len(args[3])), "", " " * (15-len(args[3])), "",
"", "SBo", "", "")).rstrip() "", "SBo", "", "").rstrip())
def tag(self, sbo): def tag(self, sbo):
"""Tag with color green if package already installed, """Tag with color green if package already installed,
@ -382,7 +382,7 @@ class SBoInstall(object):
ins_ver = GetFromInstalled(name).version()[1:] ins_ver = GetFromInstalled(name).version()[1:]
if not ins_ver: if not ins_ver:
ins_ver = "0" ins_ver = "0"
if LooseVersion(sbo_ver) < LooseVersion(ins_ver): if parse_version(sbo_ver) < parse_version(ins_ver):
self.msg.template(78) self.msg.template(78)
print("| Package {0} don't downgrade, " print("| Package {0} don't downgrade, "
"setting by user".format(name)) "setting by user".format(name))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# security.py file is part of slpkg. # security.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# sizes.py file is part of slpkg. # sizes.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# mirrors.py file is part of slpkg. # mirrors.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# patches.py file is part of slpkg. # patches.py file is part of slpkg.
@ -105,7 +105,7 @@ class Patches(object):
print("{0}Total {1} {2} will be upgraded and {3} will be " print("{0}Total {1} {2} will be upgraded and {3} will be "
"installed.".format(self.meta.color["GREY"], "installed.".format(self.meta.color["GREY"],
self.count_upg, self.count_upg,
self.msg.pkg(self.upgrade_all), self.msg.pkg(len(self.upgrade_all)),
self.count_added)) self.count_added))
print("Need to get {0} {1} of archives.".format(size[0], print("Need to get {0} {1} of archives.".format(size[0],
unit[0])) unit[0]))
@ -201,7 +201,7 @@ class Patches(object):
" " * (18-len(pkg_repo[1])), pkg_repo[2], " " * (18-len(pkg_repo[1])), pkg_repo[2],
" " * (8-len(pkg_repo[2])), pkg_repo[3], " " * (8-len(pkg_repo[2])), pkg_repo[3],
" " * (7-len(pkg_repo[3])), "Slack", " " * (7-len(pkg_repo[3])), "Slack",
size, " K")).rstrip() size, " K").rstrip())
def upgrade(self): def upgrade(self):
""" """
@ -246,7 +246,7 @@ class Patches(object):
print("| L=lilo / E=elilo / G=grub") print("| L=lilo / E=elilo / G=grub")
self.msg.template(78) self.msg.template(78)
try: try:
answer = raw_input("\nThe kernel has been upgraded, " answer = input("\nThe kernel has been upgraded, "
"reinstall boot loader [L/E/G]? ") "reinstall boot loader [L/E/G]? ")
except EOFError: except EOFError:
print("") print("")

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slack_version.py file is part of slpkg. # slack_version.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slackware_repo.py file is part of slpkg. # slackware_repo.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slpkg_update.py file is part of slpkg. # slpkg_update.py file is part of slpkg.
@ -59,7 +59,7 @@ def it_self_update():
print("\nNew version '{0}-{1}' is available !\n".format( print("\nNew version '{0}-{1}' is available !\n".format(
_meta_.__all__, __new_version__)) _meta_.__all__, __new_version__))
try: try:
answer = raw_input("Would you like to upgrade [y/N]? ") answer = input("Would you like to upgrade [y/N]? ")
except EOFError: except EOFError:
print("") print("")
raise SystemExit() raise SystemExit()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# splitting.py file is part of slpkg. # splitting.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# status_deps.py file is part of slpkg. # status_deps.py file is part of slpkg.
@ -89,7 +89,7 @@ class DependenciesStatus(object):
self.msg.template(78) self.msg.template(78)
print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages")) print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
self.msg.template(78) self.msg.template(78)
for key, value in self.dmap.iteritems(): for key, value in self.dmap.items():
print(" {0}{1}{2}{3}{4}".format( print(" {0}{1}{2}{3}{4}".format(
self.green, key, self.endc, " " * (32-len(key)), self.green, key, self.endc, " " * (32-len(key)),
", ".join(value))) ", ".join(value)))
@ -105,14 +105,14 @@ class DependenciesStatus(object):
"| -- Packages") "| -- Packages")
self.msg.template(78) self.msg.template(78)
self.data() self.data()
for pkg, dep in self.dmap.iteritems(): for pkg, dep in self.dmap.items():
print("+ {0}{1}{2}".format(self.green, pkg, self.endc)) print("+ {0}{1}{2}".format(self.green, pkg, self.endc))
print("|") print("|")
for d in dep: for d in dep:
print("+-- {0}".format(d)) print("+-- {0}".format(d))
print("|") print("|")
sys.stdout.write("\x1b[1A{0}\n".format(" ")) print("\x1b[1A{0}\n".format(" "), end="")
sys.stdout.flush() print(end="", flush=True)
self.summary() self.summary()
if self.image: if self.image:
Graph(self.image).dependencies(self.dmap) Graph(self.image).dependencies(self.dmap)

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# superuser.py file is part of slpkg. # superuser.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# toolbar.py file is part of slpkg. # toolbar.py file is part of slpkg.
@ -34,7 +34,7 @@ def status(sec):
if _meta_.prg_bar in ["on", "ON"]: if _meta_.prg_bar in ["on", "ON"]:
syms = ["|", "/", "-", "\\"] syms = ["|", "/", "-", "\\"]
for sym in syms: for sym in syms:
sys.stdout.write("\b{0}{1}{2}".format(_meta_.color["GREY"], sym, print("\b{0}{1}{2}".format(_meta_.color["GREY"], sym,
_meta_.color["ENDC"])) _meta_.color["ENDC"]), end="")
sys.stdout.flush() print(end="", flush=True)
time.sleep(float(sec)) time.sleep(float(sec))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# tracking.py file is part of slpkg. # tracking.py file is part of slpkg.
@ -148,7 +148,7 @@ class TrackingDeps(object):
if "--case-ins" in self.flag: if "--case-ins" in self.flag:
data = SBoGrep(name="").names() data = SBoGrep(name="").names()
data_dict = Utils().case_sensitive(data) data_dict = Utils().case_sensitive(data)
for key, value in data_dict.iteritems(): for key, value in data_dict.items():
if key == self.name.lower(): if key == self.name.lower():
self.name = value self.name = value
@ -158,7 +158,7 @@ class TrackingDeps(object):
""" """
if "--case-ins" in self.flag: if "--case-ins" in self.flag:
data_dict = Utils().case_sensitive(self.names) data_dict = Utils().case_sensitive(self.names)
for key, value in data_dict.iteritems(): for key, value in data_dict.items():
if key == self.name.lower(): if key == self.name.lower():
self.name = value self.name = value

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# upgrade_checklist.py file is part of slpkg. # upgrade_checklist.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# url_read.py file is part of slpkg. # url_read.py file is part of slpkg.
@ -22,8 +22,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os # import os
import urllib2 import urllib
from urllib.request import urlopen
from slpkg.__metadata__ import MetaData as _meta_ from slpkg.__metadata__ import MetaData as _meta_
@ -39,6 +40,7 @@ class URL(object):
"""Open url and read """Open url and read
""" """
try: try:
'''
# testing proxy # testing proxy
proxies = {} proxies = {}
try: try:
@ -54,11 +56,11 @@ class URL(object):
proxy = urllib2.ProxyHandler(proxies) proxy = urllib2.ProxyHandler(proxies)
opener = urllib2.build_opener(proxy) opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener) urllib2.install_opener(opener)
# end testing # end testing
f = urllib2.urlopen(self.link) '''
return f.read() f = urlopen(self.link)
except (urllib2.URLError, ValueError): return f.read().decode("utf-8")
except (urllib.error.URLError, ValueError):
print("\n{0}Can't read the file '{1}'{2}".format( print("\n{0}Can't read the file '{1}'{2}".format(
self.meta.color["RED"], self.link.split("/")[-1], self.meta.color["RED"], self.link.split("/")[-1],
self.meta.color["ENDC"])) self.meta.color["ENDC"]))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# utils.py file is part of slpkg. # utils.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# version.py file is part of slpkg. # version.py file is part of slpkg.