Merge pull request #1 from wvragga/master

Changed pkg_list in manager.py to add sorting to lists
This commit is contained in:
Dimitris Zlatanidis 2014-08-15 22:07:09 +03:00
commit dfc099689c

View file

@ -209,7 +209,7 @@ def pkg_list(binary):
print # new line at start
index, page = 0, 50
if "all" in binary:
for pkg in os.listdir(pkg_path):
for pkg in sorted(os.listdir(pkg_path)):
index += 1
print("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
if index == page:
@ -217,7 +217,7 @@ def pkg_list(binary):
colors.CYAN, colors.ENDC))
page += 50
if "sbo" in binary:
for pkg in os.listdir(pkg_path):
for pkg in sorted(os.listdir(pkg_path)):
if 'SBo' in pkg:
index += 1
print("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
@ -226,7 +226,7 @@ def pkg_list(binary):
colors.CYAN, colors.ENDC))
page += 50
if "slack" in binary:
for pkg in os.listdir(pkg_path):
for pkg in sorted(os.listdir(pkg_path)):
if 'slack' in pkg:
index += 1
print("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
@ -235,7 +235,7 @@ def pkg_list(binary):
colors.CYAN, colors.ENDC))
page += 50
if "noarch" in binary:
for pkg in os.listdir(pkg_path):
for pkg in sorted(os.listdir(pkg_path)):
if 'noarch' in pkg:
index += 1
print("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
@ -244,7 +244,7 @@ def pkg_list(binary):
colors.CYAN, colors.ENDC))
page += 50
if "other" in binary:
for pkg in os.listdir(pkg_path):
for pkg in sorted(os.listdir(pkg_path)):
if 'SBo' in pkg or 'slack' in pkg or 'noarch' in pkg:
pass
else: