mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-16 03:41:11 +01:00
Update the messages and fix typo
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
981bdb6b78
commit
f0e6dd4ca7
9 changed files with 26 additions and 25 deletions
|
@ -53,7 +53,7 @@ class BlackList(object):
|
||||||
def listed(self):
|
def listed(self):
|
||||||
"""Print blacklist packages
|
"""Print blacklist packages
|
||||||
"""
|
"""
|
||||||
print("\nPackages in blacklist:\n")
|
print("\nPackages in the blacklist:\n")
|
||||||
for black in self.get_black():
|
for black in self.get_black():
|
||||||
if black:
|
if black:
|
||||||
print("{0}{1}{2}".format(self.meta.color["GREEN"], black,
|
print("{0}{1}{2}".format(self.meta.color["GREEN"], black,
|
||||||
|
@ -67,7 +67,7 @@ class BlackList(object):
|
||||||
"""
|
"""
|
||||||
blacklist = self.get_black()
|
blacklist = self.get_black()
|
||||||
pkgs = set(pkgs)
|
pkgs = set(pkgs)
|
||||||
print("\nAdd packages in blacklist:\n")
|
print("\nAdd packages in the blacklist:\n")
|
||||||
with open(self.blackfile, "a") as black_conf:
|
with open(self.blackfile, "a") as black_conf:
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
if pkg not in blacklist:
|
if pkg not in blacklist:
|
||||||
|
@ -82,7 +82,7 @@ class BlackList(object):
|
||||||
def remove(self, pkgs):
|
def remove(self, pkgs):
|
||||||
"""Remove packages from blacklist
|
"""Remove packages from blacklist
|
||||||
"""
|
"""
|
||||||
print("\nRemove packages from blacklist:\n")
|
print("\nRemove packages from the blacklist:\n")
|
||||||
with open(self.blackfile, "w") as remove:
|
with open(self.blackfile, "w") as remove:
|
||||||
for line in self.black_conf.splitlines():
|
for line in self.black_conf.splitlines():
|
||||||
if line not in pkgs:
|
if line not in pkgs:
|
||||||
|
|
|
@ -99,8 +99,8 @@ class ArgParse(object):
|
||||||
"-F", "--FIND",
|
"-F", "--FIND",
|
||||||
"-f", "--find"
|
"-f", "--find"
|
||||||
] and self.args[1] == repo and repo in enabled_repos:
|
] and self.args[1] == repo and repo in enabled_repos:
|
||||||
print("\n Please update packages lists. Run 'slpkg update'.\n" +
|
print("\n Please update the packages lists. Run 'slpkg update'.\n"
|
||||||
" This command should be used to synchronize packages\n" +
|
" This command should be used to synchronize the packages\n"
|
||||||
" lists from the repositories are enabled.\n")
|
" lists from the repositories are enabled.\n")
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,9 @@ class Msg(object):
|
||||||
print("| Some error on the package {0} [ {1}FAILED{2} ]".format(
|
print("| Some error on the package {0} [ {1}FAILED{2} ]".format(
|
||||||
prgnam, self.meta.color["RED"], self.meta.color["ENDC"]))
|
prgnam, self.meta.color["RED"], self.meta.color["ENDC"]))
|
||||||
self.template(78)
|
self.template(78)
|
||||||
print("| See log file in '{0}/var/log/slpkg/sbo/build_logs{1}' "
|
print("| See the log file in '{0}/var/log/slpkg/sbo/build_logs{1}' "
|
||||||
"directory or read README".format(self.meta.color["CYAN"],
|
"directory or read the README file".format(
|
||||||
self.meta.color["ENDC"]))
|
self.meta.color["CYAN"], self.meta.color["ENDC"]))
|
||||||
self.template(78)
|
self.template(78)
|
||||||
print("") # new line at end
|
print("") # new line at end
|
||||||
|
|
||||||
|
@ -139,9 +139,9 @@ class Msg(object):
|
||||||
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"])
|
||||||
self.template(78)
|
self.template(78)
|
||||||
print("| Before proceed with package '{0}' will you must read the\n"
|
print("| Before proceed with the package '{0}' will you must read\n"
|
||||||
"| README file. You can use command 'slpkg -n {1}'").format(
|
"| the README file. You can use the command "
|
||||||
pkg, pkg)
|
"'slpkg -n {1}'").format(pkg, pkg)
|
||||||
self.template(78)
|
self.template(78)
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ class BuildPackage(object):
|
||||||
sum_time = build_time(self.start_time)
|
sum_time = build_time(self.start_time)
|
||||||
# write end in log file
|
# write end in log file
|
||||||
log_end(self.build_logs, self.log_file, sum_time)
|
log_end(self.build_logs, self.log_file, sum_time)
|
||||||
print("Total build time for package {0} : {1}\n".format(
|
print("Total build time for the package {0} : {1}\n".format(
|
||||||
self.prgnam, sum_time))
|
self.prgnam, sum_time))
|
||||||
else:
|
else:
|
||||||
subprocess.call("{0} ./{1}.SlackBuild".format(
|
subprocess.call("{0} ./{1}.SlackBuild".format(
|
||||||
|
|
|
@ -185,7 +185,7 @@ class PackageManager(object):
|
||||||
removed, packages = self._get_removed()
|
removed, packages = self._get_removed()
|
||||||
if packages and "--checklist" in self.extra:
|
if packages and "--checklist" in self.extra:
|
||||||
removed = []
|
removed = []
|
||||||
text = "Press 'spacebar' to unchoose packages from remove"
|
text = "Press 'spacebar' to unchoose packages from the remove"
|
||||||
backtitle = "{0} {1}".format(self.meta.__all__,
|
backtitle = "{0} {1}".format(self.meta.__all__,
|
||||||
self.meta.__version__)
|
self.meta.__version__)
|
||||||
status = True
|
status = True
|
||||||
|
@ -239,7 +239,7 @@ class PackageManager(object):
|
||||||
if packages:
|
if packages:
|
||||||
if "--checklist" in self.extra:
|
if "--checklist" in self.extra:
|
||||||
deps, dependencies = [], []
|
deps, dependencies = [], []
|
||||||
text = "Found dependencies for package {0}".format(package)
|
text = "Found dependencies for the package {0}".format(package)
|
||||||
backtitle = "{0} {1}".format(self.meta.__all__,
|
backtitle = "{0} {1}".format(self.meta.__all__,
|
||||||
self.meta.__version__)
|
self.meta.__version__)
|
||||||
status = True
|
status = True
|
||||||
|
@ -251,7 +251,8 @@ class PackageManager(object):
|
||||||
else:
|
else:
|
||||||
print("") # new line at start
|
print("") # new line at start
|
||||||
self.msg.template(78)
|
self.msg.template(78)
|
||||||
print("| Found dependencies for package {0}:".format(package))
|
print("| Found dependencies for the package {0}:".format(
|
||||||
|
package))
|
||||||
self.msg.template(78)
|
self.msg.template(78)
|
||||||
for pkg in packages:
|
for pkg in packages:
|
||||||
find = find_package(pkg + self.meta.sp, self.meta.pkg_path)
|
find = find_package(pkg + self.meta.sp, self.meta.pkg_path)
|
||||||
|
@ -333,8 +334,8 @@ class PackageManager(object):
|
||||||
dependency.append(rmv)
|
dependency.append(rmv)
|
||||||
if package:
|
if package:
|
||||||
if "--checklist" in self.extra:
|
if "--checklist" in self.extra:
|
||||||
text = ("Press 'spacebar' to choose packages to exception "
|
text = ("Press 'spacebar' to choose packages for the remove"
|
||||||
"remove")
|
" exception")
|
||||||
backtitle = "{0} {1}".format(self.meta.__all__,
|
backtitle = "{0} {1}".format(self.meta.__all__,
|
||||||
self.meta.__version__)
|
self.meta.__version__)
|
||||||
status = False
|
status = False
|
||||||
|
|
|
@ -70,7 +70,7 @@ class RepoList(object):
|
||||||
print("=" * 79)
|
print("=" * 79)
|
||||||
print("{0}{1}/{2} enabled default repositories and {3} custom.".format(
|
print("{0}{1}/{2} enabled default repositories and {3} custom.".format(
|
||||||
self.meta.color["GREY"], def_cnt, len(self.all_repos), cus_cnt))
|
self.meta.color["GREY"], def_cnt, len(self.all_repos), cus_cnt))
|
||||||
print("For enable or disable default repositories edit "
|
print("Edit the file '/etc/slpkg/repositories.conf' for enable "
|
||||||
"'/etc/slpkg/repositories.conf'\nfile or run 'slpkg "
|
"and disable default\nrepositories or run 'slpkg "
|
||||||
"repo-enable' command.\n{0}".format(self.meta.color["ENDC"]))
|
"repo-enable' command.\n{0}".format(self.meta.color["ENDC"]))
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
|
@ -79,7 +79,7 @@ class QueuePkgs(object):
|
||||||
def listed(self):
|
def listed(self):
|
||||||
"""Print packages from queue
|
"""Print packages from queue
|
||||||
"""
|
"""
|
||||||
print("\nPackages in queue:\n")
|
print("\nPackages in the queue:\n")
|
||||||
for pkg in self.packages():
|
for pkg in self.packages():
|
||||||
if pkg:
|
if pkg:
|
||||||
print("{0}{1}{2}".format(self.meta.color["GREEN"], pkg,
|
print("{0}{1}{2}".format(self.meta.color["GREEN"], pkg,
|
||||||
|
@ -93,7 +93,7 @@ class QueuePkgs(object):
|
||||||
"""
|
"""
|
||||||
queue_list = self.packages()
|
queue_list = self.packages()
|
||||||
pkgs = list(OrderedDict.fromkeys(pkgs))
|
pkgs = list(OrderedDict.fromkeys(pkgs))
|
||||||
print("\nAdd packages in queue:\n")
|
print("\nAdd packages in the queue:\n")
|
||||||
with open(self.queue_list, "a") as queue:
|
with open(self.queue_list, "a") as queue:
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
find = sbo_search_pkg(pkg)
|
find = sbo_search_pkg(pkg)
|
||||||
|
@ -113,7 +113,7 @@ class QueuePkgs(object):
|
||||||
def remove(self, pkgs):
|
def remove(self, pkgs):
|
||||||
"""Remove packages from queue
|
"""Remove packages from queue
|
||||||
"""
|
"""
|
||||||
print("\nRemove packages from queue:\n")
|
print("\nRemove packages from the queue:\n")
|
||||||
with open(self.queue_list, "w") as queue:
|
with open(self.queue_list, "w") as queue:
|
||||||
for line in self.queued.splitlines():
|
for line in self.queued.splitlines():
|
||||||
if line not in pkgs:
|
if line not in pkgs:
|
||||||
|
|
|
@ -272,8 +272,8 @@ class Patches(object):
|
||||||
"""Update packages list and ChangeLog.txt file after
|
"""Update packages list and ChangeLog.txt file after
|
||||||
upgrade distribution
|
upgrade distribution
|
||||||
"""
|
"""
|
||||||
print("{0}Update package lists ?{1}".format(self.meta.color["GREEN"],
|
print("{0}Update the package lists ?{1}".format(
|
||||||
self.meta.color["ENDC"]))
|
self.meta.color["GREEN"], self.meta.color["ENDC"]))
|
||||||
print("=" * 79)
|
print("=" * 79)
|
||||||
if self.msg.answer() in ["y", "Y"]:
|
if self.msg.answer() in ["y", "Y"]:
|
||||||
Update().repository(["slack"])
|
Update().repository(["slack"])
|
||||||
|
|
|
@ -59,7 +59,7 @@ class URL(object):
|
||||||
f = urllib2.urlopen(self.link)
|
f = urllib2.urlopen(self.link)
|
||||||
return f.read()
|
return f.read()
|
||||||
except (urllib2.URLError, ValueError):
|
except (urllib2.URLError, ValueError):
|
||||||
print("\n{0}Can't read 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"]))
|
||||||
return " "
|
return " "
|
||||||
|
|
Loading…
Reference in a new issue