added colors

This commit is contained in:
Dimitris Zlatanidis 2014-09-02 07:59:53 +03:00
parent 2d7c821cc9
commit 086316ffdf

View file

@ -25,7 +25,6 @@ import os
import sys import sys
import subprocess import subprocess
from pkg.find import find_package
from pkg.build import build_package from pkg.build import build_package
from pkg.manager import pkg_upgrade from pkg.manager import pkg_upgrade
@ -50,6 +49,7 @@ def sbo_check():
sys.stdout.flush() sys.stdout.flush()
initialization() initialization()
index, toolbar_width = 0, 3 index, toolbar_width = 0, 3
GREEN, RED, ENDC = colors.GREEN, colors.RED, colors.ENDC
pkg_name, sbo_ver, pkg_for_upg = [], [], [] pkg_name, sbo_ver, pkg_for_upg = [], [], []
sbo_list, pkg_arch = [], [] sbo_list, pkg_arch = [], []
for pkg in os.listdir(pkg_path): for pkg in os.listdir(pkg_path):
@ -89,7 +89,7 @@ def sbo_check():
template(78) template(78)
print("Upgrading:") print("Upgrading:")
for upg, ver, arch in zip(pkg_for_upg, sbo_ver, pkg_arch): for upg, ver, arch in zip(pkg_for_upg, sbo_ver, pkg_arch):
print " ", upg, " "*(34-len(upg)), ver, \ print " ", RED + upg + ENDC, " "*(34-len(upg)), GREEN + ver + ENDC, \
" "*(16-len(ver)), arch, " "*(11-len(arch)), "SBo" " "*(16-len(ver)), arch, " "*(11-len(arch)), "SBo"
msg_pkg = "package" msg_pkg = "package"
if len(pkg_for_upg) > 1: if len(pkg_for_upg) > 1: