Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2015-02-26 10:32:46 +02:00
commit a3d74039a4
6 changed files with 28 additions and 13 deletions

View file

@ -1,3 +1,11 @@
Version 2.2.6
26-2-2015
[Feature] - Added counter download.
[Updated] - Update Slackware release message.
Version 2.2.5
24-2-2015

View file

@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: slpkg
Version: 2.2.5
Version: 2.2.6
Author: dslackw
Author-email: d zlatanidis at gmail com
Maintainer: dslackw

View file

@ -23,6 +23,11 @@
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/slpkg_package.png
:target: https://github.com/dslackw/slpkg
|
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/poweredbyslack.gif
:target: http://www.slackware.com/
|
.. contents:: Table of Contents:

View file

@ -79,16 +79,15 @@ def select_slack_release(slack_rel):
defined wrong
'''
if slack_rel not in ['stable', 'current']:
print("\n You have not specified the Slackware release.\n"
" Edit file '/etc/slpkg/slpkg.conf' and change the \n"
" value of the variable RELEASE.\n")
return 'FAULT'
return slack_rel
class MetaData(object):
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (2, 2, 5)
__version_info__ = (2, 2, 6)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
@ -131,6 +130,7 @@ class MetaData(object):
'slackr', 'slonly', 'ktown', 'multi', 'slacke',
'salix', 'slackl', 'rested']
# read value from configuration file
if os.path.isfile('%s%s' % (conf_path, 'slpkg.conf')):
f = open('%s%s' % (conf_path, 'slpkg.conf'), 'r')
conf = f.read()
@ -164,7 +164,7 @@ class MetaData(object):
repositories = [repo.strip() for repo in repositories]
# Check Slackware release
select_slack_release(slack_rel)
slack_rel = select_slack_release(slack_rel)
# Grap sub repositories
ktown_kde_repo = grab_sub_repo(repositories, 'ktown')

View file

@ -28,8 +28,8 @@ from __metadata__ import MetaData as _m
def options():
arguments = [
"\nslpkg - version {0} | set: {1}\n".format(_m.__version__,
_m.slack_rel),
"\nslpkg - version {0} | Slackware release: {1}\n".format(
_m.__version__, _m.slack_rel),
"Slpkg is a user-friendly package manager for Slackware "
"installations\n",
"Commands:",
@ -88,8 +88,8 @@ def usage(repo):
error_repo = ("slpkg: error: repository '{0}' does not exist"
"\n".format(repo))
view = [
"\nslpkg - version {0} | set: {1}\n".format(_m.__version__,
_m.slack_rel),
"\nslpkg - version {0} | Slackware release: {1}\n".format(
_m.__version__, _m.slack_rel),
"Usage: slpkg Commands:",
" [update] [upgrade] [repo-add [repository name] [URL]]",
" [repo-remove [repository]] [repo-list]",

View file

@ -40,15 +40,17 @@ class Download(object):
'''
Download files usign wget.
'''
dwn_count = 1
for dwn in self.url:
self.file_name = dwn.split("/")[-1]
print("\n[ {0}Download{1} ] -->{1} {2}\n".format(_m.color['GREEN'],
_m.color['ENDC'],
self.file_name))
print("\n[{0}/{1}][ {2}Download{3} ] --> {4}\n".format(
dwn_count, len(self.url), _m.color['GREEN'], _m.color['ENDC'],
self.file_name))
try:
subprocess.call("wget {0} --directory-prefix={1} {2}".format(
self.wget_options, self.path, dwn), shell=True)
self._check_if_downloaded()
dwn_count += 1
except KeyboardInterrupt:
print # new line at cancel
sys.exit(0)