From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QM0qw-0002mo-H2 for garchives@archives.gentoo.org; Mon, 16 May 2011 16:41:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 50F501C12D; Mon, 16 May 2011 16:40:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 118641C12D for ; Mon, 16 May 2011 16:40:58 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5A3D11B4040 for ; Mon, 16 May 2011 16:40:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 825D27448A for ; Mon, 16 May 2011 16:40:57 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eshowkw/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/eshowkw/__init__.py pym/gentoolkit/eshowkw/display_pretty.py pym/gentoolkit/eshowkw/keywords_content.py pym/gentoolkit/eshowkw/keywords_header.py X-VCS-Directories: pym/gentoolkit/eshowkw/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: f5def123a156abc90841da2ade2601f06623010d Date: Mon, 16 May 2011 16:40:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 8c58eed7b5065301751a51f001df6dad commit: f5def123a156abc90841da2ade2601f06623010d Author: dol-sen gmail com> AuthorDate: Mon May 16 16:38:02 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Mon May 16 16:38:02 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3Df5def123 fix py3 compatibility issues in eshowkw. --- pym/gentoolkit/eshowkw/__init__.py | 12 +++++++----- pym/gentoolkit/eshowkw/display_pretty.py | 9 ++++++--- pym/gentoolkit/eshowkw/keywords_content.py | 6 +++--- pym/gentoolkit/eshowkw/keywords_header.py | 4 ++-- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pym/gentoolkit/eshowkw/__init__.py b/pym/gentoolkit/eshowkw/= __init__.py index 9c70bee..e0544a9 100644 --- a/pym/gentoolkit/eshowkw/__init__.py +++ b/pym/gentoolkit/eshowkw/__init__.py @@ -14,10 +14,10 @@ from portage import config as portc from portage import portdbapi as portdbapi from portage import db as portdb =20 -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 =20 ignore_slots =3D False bold =3D False @@ -25,6 +25,7 @@ order =3D 'bottom' topper =3D 'versionlist' =20 def process_display(package, keywords, dbapi): + portdata =3D keywords_content(package, keywords.keywords, dbapi, ignore= _slots, order, bold, topper) if topper =3D=3D 'archlist': header =3D string_rotator().rotateContent(keywords.content, keywords.l= ength, bold) @@ -108,7 +109,8 @@ def main(argv, indirect =3D False): dbapi =3D portdbapi(mysettings=3Dmysettings) if not use_overlays: dbapi.porttrees =3D [dbapi.porttree_root] - map(lambda x: process_display(x, keywords, dbapi), package) + for pkg in package: + process_display(pkg, keywords, dbapi) else: currdir =3D os.getcwd() # check if there are actualy some ebuilds diff --git a/pym/gentoolkit/eshowkw/display_pretty.py b/pym/gentoolkit/es= howkw/display_pretty.py index 270a0eb..beca5f4 100644 --- a/pym/gentoolkit/eshowkw/display_pretty.py +++ b/pym/gentoolkit/eshowkw/display_pretty.py @@ -3,7 +3,10 @@ # Distributed under the terms of the GNU General Public License v2 =20 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 =20 __all__ =3D ['string_rotator', 'colorize_string', 'align_string', 'rotat= e_dash', 'print_content', 'display'] =20 @@ -17,14 +20,14 @@ def display(plain_list, rotated_list, plain_width, ro= tated_height, cp, toplist =3D if toplist !=3D 'archlist': corner_image.extend(plain_list) data_printout =3D ['%s%s' % (x, y) - for x, y in izip_longest(corner_image, rotated_list, fillvalue=3Dcorne= r_image[0])] + for x, y in zip_longest(corner_image, rotated_list, fillvalue=3Dcorner= _image[0])] if toplist =3D=3D 'archlist': data_printout.extend(plain_list) output.extend(data_printout) print(print_content(output)) =20 def align_string(string, align, length): - """Align string to the specified alignment (left or right, and after ro= tation it becames top and bottom)""" + """Align string to the specified alignment (left or right, and after ro= tation it becomes top and bottom)""" if align =3D=3D 'top' or align =3D=3D 'left': string =3D string.ljust(length) else: diff --git a/pym/gentoolkit/eshowkw/keywords_content.py b/pym/gentoolkit/= eshowkw/keywords_content.py index 637c99a..99d652e 100644 --- a/pym/gentoolkit/eshowkw/keywords_content.py +++ b/pym/gentoolkit/eshowkw/keywords_content.py @@ -8,8 +8,8 @@ from portage.output import colorize =20 __all__ =3D ['keywords_content'] =20 -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 =20 class keywords_content: class RedundancyChecker: @@ -101,7 +101,7 @@ class keywords_content: def __getVersions(self, packages): """Obtain properly aligned version strings without colors.""" revlength =3D 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] =20 def __getRevision(self, cpv): """Get revision informations for each package for nice further alignm= ent""" diff --git a/pym/gentoolkit/eshowkw/keywords_header.py b/pym/gentoolkit/e= showkw/keywords_header.py index 23588a4..f7e3e50 100644 --- a/pym/gentoolkit/eshowkw/keywords_header.py +++ b/pym/gentoolkit/eshowkw/keywords_header.py @@ -6,8 +6,8 @@ __all__ =3D ['keywords_header'] =20 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 =20 class keywords_header: __IMPARCHS =3D [ 'arm', 'amd64', 'x86' ]