update messages

This commit is contained in:
Dimitris Zlatanidis 2014-08-27 07:34:35 +03:00
parent 3478342d75
commit 3608a12ae1

View file

@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# messages.py
# messages.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify
# Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@ -29,41 +29,41 @@ def pkg_not_found(bol, pkg, message, eol):
'''
Print message when package not found
'''
print ("{0}No such package {1}: {2}{3}".format(bol, pkg, message, eol))
print("{0}No such package {1}: {2}{3}".format(bol, pkg, message, eol))
def pkg_found(pkg, version):
'''
Print message when package found
'''
print ("| Package {0}-{1} is already installed".format(pkg, version))
print("| Package {0}-{1} is already installed".format(pkg, version))
def pkg_installed(pkg):
'''
Print message when package installed
'''
print ("| Package {0} installed".format(pkg))
print("| Package {0} installed".format(pkg))
def ext_err_args():
'''
Extended error arguments view
'''
print ("usage: {0} [-h] [-v] [-a script [source ...]] [-l all, sbo, slack, noarch]".format(__all__))
print (" [-c sbo, slack [sbo, slack ...]]")
print (" [-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]]")
print (" [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]")
print("usage: {0} [-h] [-v] [-a script [sources ...]]".format(__all__))
print(" [-l all, sbo, slack, noarch] [-c sbo, slack [<upgrade> ...]]")
print(" [-s sbo, slack [<package> ...]] [-t] [-n] [-i [...]]")
print(" [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]")
def err1_args(invalid, choices):
'''
Print error message arguments
'''
print ("{0}: error: invalid choice: '{1}' choose from {2}".format(
print("{0}: error: invalid choice: '{1}' choose from {2}".format(
__all__, invalid, choices))
def err2_args(choices):
'''
Print error message arguments
'''
print ("{0}: error: must enter at least two arguments: choose {1}".format(
print("{0}: error: must enter at least two arguments: choose {1}".format(
__all__, choices))
def s_user(user):
@ -71,14 +71,14 @@ def s_user(user):
Check for root user
'''
if user != "root":
print ("\nError: must have root privileges\n")
print("\nError: must have root privileges\n")
sys.exit()
def template(max):
'''
Print view template
'''
print ("+" + "=" * max)
print("+" + "=" * max)
def view_sbo(pkg, sbo_url, sbo_dwn, source_dwn, sbo_req):
print # new line at start