From 01083994795dec1ca6c366ea7a494364ce4e15f8 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Thu, 24 Feb 2011 18:06:04 -0800 Subject: [PATCH] decorate some functions as @staticmethod --- pym/gentoolkit/eshowkw/keywords_header.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pym/gentoolkit/eshowkw/keywords_header.py b/pym/gentoolkit/eshowkw/keywords_header.py index 1d52749..23588a4 100644 --- a/pym/gentoolkit/eshowkw/keywords_header.py +++ b/pym/gentoolkit/eshowkw/keywords_header.py @@ -14,12 +14,14 @@ class keywords_header: __ADDITIONAL_FIELDS = [ 'unused', 'slot' ] __EXTRA_FIELDS = [ 'repo' ] - def __readKeywords(self): + @staticmethod + def __readKeywords(): """Read all available keywords from portage.""" return [x for x in ports.archlist() if not x.startswith('~')] - def __sortKeywords(self, keywords, prefix = False, required_keywords = []): + @staticmethod + def __sortKeywords(keywords, prefix = False, required_keywords = []): """Sort keywords with short archs first""" # user specified only some keywords to display if len(required_keywords) != 0: @@ -62,7 +64,8 @@ class keywords_header: tmp.append(keyword) return tmp - def __formatAdditional(self, additional, align, length): + @staticmethod + def __formatAdditional(additional, align, length): """Align additional items properly""" # % are used as separators for further split so we wont loose spaces and coloring return ['%'.join(align_string(x, align, length)) for x in additional] -- 2.26.2