Updated to generator

This commit is contained in:
Dimitris Zlatanidis 2020-02-14 15:51:28 +01:00
parent 25e854963c
commit 5af8876956

View file

@ -37,7 +37,8 @@ from slpkg.sbo.greps import SBoGrep
def sbo_upgrade(skip, flag):
"""Return packages for upgrade
"""
Msg().checking()
msg = Msg()
msg.checking()
upgrade_names = []
data = SBoGrep(name="").names()
blacklist = BlackList().get_black()
@ -49,7 +50,7 @@ def sbo_upgrade(skip, flag):
package = f"{name}-{ver}"
if parse_version(sbo_package) > parse_version(package):
upgrade_names.append(name)
Msg().done()
msg.done()
if "--checklist" in flag:
upgrade_names = choose_upg(upgrade_names)
return upgrade_names
@ -58,8 +59,6 @@ def sbo_upgrade(skip, flag):
def sbo_list():
"""Return all SBo packages
"""
sbo_packages = []
for pkg in os.listdir(_meta_.pkg_path):
if pkg.endswith("_SBo"):
sbo_packages.append(pkg)
return sbo_packages
yield pkg