From: dol-sen Date: Wed, 18 May 2011 21:17:19 +0000 (-0700) Subject: add keywords formatter option. X-Git-Tag: gentoolkit-0.3.0.4~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=28fbebb3c0d0cc04cdd84963c3a7168dc13fb048;p=gentoolkit.git add keywords formatter option. --- diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py index a4031a3..e405412 100644 --- a/pym/gentoolkit/package.py +++ b/pym/gentoolkit/package.py @@ -36,7 +36,7 @@ __all__ = ( FORMAT_TMPL_VARS = ( '$location', '$mask', '$mask2', '$cp', '$cpv', '$category', '$name', - '$version', '$revision', '$fullversion', '$slot', '$repo' + '$version', '$revision', '$fullversion', '$slot', '$repo', '$keywords' ) # ======= @@ -470,6 +470,7 @@ class PackageFormatter(object): "fullversion") fmt_vars.addLazySingleton("slot", self.format_slot) fmt_vars.addLazySingleton("repo", self.pkg.repo_name) + fmt_vars.addLazySingleton("keywords", self.format_keywords) def format_package_location(self): """Get the install status (in /var/db/?) and origin (from an overlay @@ -570,5 +571,12 @@ class PackageFormatter(object): else: return value + def format_keywords(self): + value = self.pkg.environment("KEYWORDS") + if self._do_format: + return pp.keyword(value) + else: + return value + # vim: set ts=4 sw=4 tw=79: