aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordol-sen <brian.dolbec@gmail.com>2011-05-18 14:17:19 -0700
committerdol-sen <brian.dolbec@gmail.com>2011-05-18 14:17:19 -0700
commit28fbebb3c0d0cc04cdd84963c3a7168dc13fb048 (patch)
treed141a1fd8b722edca441eacbb8f55769e0e62238
parentfound a better spot to set piping wrap width so as to disable for all piping ... (diff)
downloadgentoolkit-28fbebb3c0d0cc04cdd84963c3a7168dc13fb048.tar.gz
gentoolkit-28fbebb3c0d0cc04cdd84963c3a7168dc13fb048.tar.bz2
gentoolkit-28fbebb3c0d0cc04cdd84963c3a7168dc13fb048.zip
add keywords formatter option.
-rw-r--r--pym/gentoolkit/package.py10
1 files changed, 9 insertions, 1 deletions
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: