Kaydet (Commit) ef797662 authored tarafından Ali Rıza KESKİN's avatar Ali Rıza KESKİN

fast list-installed

üst c1034448
......@@ -91,15 +91,15 @@ all repositories.
if ctx.config.get_option('uninstalled') and p in installed_list:
continue
package = self.packagedb.get_package(p, repo)
psum = self.packagedb.get_summary(p,repo)
if p in installed_list:
package.name = util.colorize(package.name, 'green')
pkgname = util.colorize(p, 'green')
else:
package.name = util.colorize(package.name, 'brightwhite')
pkgname = util.colorize(p, 'brightwhite')
if self.options.long:
ctx.ui.info(str(package) + '\n')
ctx.ui.info(str(p) + '\n')
else:
package.name += ' ' * max(0, maxlen - len(p))
ctx.ui.info('{0} - {1} '.format(package.name, str(package.summary)))
pkgname += ' ' * max(0, maxlen - len(p))
ctx.ui.info('{0} - {1} '.format(p, str(psum)))
......@@ -168,6 +168,12 @@ class PackageDB(lazydb.LazyDB):
return release
@staticmethod
def __get_summary(meta_doc):
summary = xmlext.getNodeText(meta_doc, 'Summary')
return summary
@staticmethod
def __get_distro_release(meta_doc):
distro = xmlext.getNodeText(meta_doc, 'Distribution')
......@@ -191,6 +197,14 @@ class PackageDB(lazydb.LazyDB):
return self.__get_version(pkg_doc)
def get_summary(self, name, repo=None):
if not self.has_package(name, repo):
raise Exception(_('Package \"{}\" not found.').format(name))
pkg_doc = xmlext.parseString(self.pdb.get_item(name, repo))
return self.__get_summary(pkg_doc)
def get_release(self, name, repo):
if not self.has_package(name, repo):
raise Exception(_('Package \"{}\" not found.').format(name))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment