from portage import portdbapi as portdbapi
from portage import db as portdb
-from .keywords_header import keywords_header
-from .keywords_content import keywords_content
-from .display_pretty import string_rotator
-from .display_pretty import display
+from gentoolkit.eshowkw.keywords_header import keywords_header
+from gentoolkit.eshowkw.keywords_content import keywords_content
+from gentoolkit.eshowkw.display_pretty import string_rotator
+from gentoolkit.eshowkw.display_pretty import display
ignore_slots = False
bold = False
topper = 'versionlist'
def process_display(package, keywords, dbapi):
+
portdata = keywords_content(package, keywords.keywords, dbapi, ignore_slots, order, bold, topper)
if topper == 'archlist':
header = string_rotator().rotateContent(keywords.content, keywords.length, bold)
dbapi = portdbapi(mysettings=mysettings)
if not use_overlays:
dbapi.porttrees = [dbapi.porttree_root]
- map(lambda x: process_display(x, keywords, dbapi), package)
+ for pkg in package:
+ process_display(pkg, keywords, dbapi)
else:
currdir = os.getcwd()
# check if there are actualy some ebuilds
# Distributed under the terms of the GNU General Public License v2
from portage.output import colorize
-from itertools import izip_longest
+try: # newer python versions
+ from itertools import zip_longest
+except ImportError: # older python naming
+ from itertools import izip_longest as zip_longest
__all__ = ['string_rotator', 'colorize_string', 'align_string', 'rotate_dash', 'print_content', 'display']
if toplist != 'archlist':
corner_image.extend(plain_list)
data_printout = ['%s%s' % (x, y)
- for x, y in izip_longest(corner_image, rotated_list, fillvalue=corner_image[0])]
+ for x, y in zip_longest(corner_image, rotated_list, fillvalue=corner_image[0])]
if toplist == 'archlist':
data_printout.extend(plain_list)
output.extend(data_printout)
print(print_content(output))
def align_string(string, align, length):
- """Align string to the specified alignment (left or right, and after rotation it becames top and bottom)"""
+ """Align string to the specified alignment (left or right, and after rotation it becomes top and bottom)"""
if align == 'top' or align == 'left':
string = string.ljust(length)
else:
__all__ = ['keywords_content']
-from display_pretty import colorize_string
-from display_pretty import align_string
+from gentoolkit.eshowkw.display_pretty import colorize_string
+from gentoolkit.eshowkw.display_pretty import align_string
class keywords_content:
class RedundancyChecker:
def __getVersions(self, packages):
"""Obtain properly aligned version strings without colors."""
revlength = max([len(self.__getRevision(x)) for x in packages])
- return map(lambda x: self.__separateVersion(x, revlength), packages)
+ return [self.__separateVersion(x, revlength) for x in packages]
def __getRevision(self, cpv):
"""Get revision informations for each package for nice further alignment"""
from portage import settings as ports
from portage.output import colorize
-from display_pretty import colorize_string
-from display_pretty import align_string
+from gentoolkit.eshowkw.display_pretty import colorize_string
+from gentoolkit.eshowkw.display_pretty import align_string
class keywords_header:
__IMPARCHS = [ 'arm', 'amd64', 'x86' ]