From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 83EE3138A1A for ; Fri, 9 Jan 2015 21:07:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BE72E086D; Fri, 9 Jan 2015 21:07:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BFA94E086D for ; Fri, 9 Jan 2015 21:07:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 73BB2340784 for ; Fri, 9 Jan 2015 21:07:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A3488F3A7 for ; Fri, 9 Jan 2015 21:07:27 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420751122.b547e16c7e047d9fd9ac7d9536678cf9102c2b16.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/gkeys/actions.py gkeys/gkeys/base.py X-VCS-Directories: gkeys/gkeys/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b547e16c7e047d9fd9ac7d9536678cf9102c2b16 X-VCS-Branch: master Date: Fri, 9 Jan 2015 21:07:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3c75a5f8-0ff4-44cd-8350-5a438f94020e X-Archives-Hash: e133d119e112d43f763e26527064fd00 commit: b547e16c7e047d9fd9ac7d9536678cf9102c2b16 Author: Pavlos Ratis gentoo org> AuthorDate: Thu Jan 8 20:42:20 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 8 21:05:22 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=b547e16c Revert "gkeys: Finally fix all the unicode printing errors" This reverts commit b7f9364cb0952f2e06f94299400d2f23b629553d. It totally broke py-3 comaptibility! --- gkeys/gkeys/actions.py | 20 +++++++++----------- gkeys/gkeys/base.py | 10 +++++----- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index 4db3757..9d57870 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -25,8 +25,6 @@ from collections import defaultdict from json import load from shutil import rmtree -from pyGPG.status import _unicode_encode - from gkeys.lib import GkeysGPG from gkeys.seedhandler import SeedHandler from gkeys.gkey import GKEY @@ -243,15 +241,15 @@ class Actions(object): if self.config.options['print_results']: if print_key: print() - print("Nick.....:", _unicode_encode(key.nick)) - print("Name.....:", _unicode_encode(key.name)) - print("Keydir...:", _unicode_encode(key.keydir)) + print("Nick.....:", key.nick) + print("Name.....:", key.name) + print("Keydir...:", key.keydir) c = 0 for line in result.split('\n'): if c == 0: - print("Gpg info.:", _unicode_encode(line)) + print("Gpg info.:", line) else: - print(" ", _unicode_encode(line)) + print(" ", line) c += 1 self.logger.debug("data output:\n" + str(result)) return (True, result) @@ -292,7 +290,7 @@ class Actions(object): str(result.failed)) if self.config.options['print_results']: for result in results[key.name]: - print("key desired:", _unicode_encode(key.name), ", key added:", + print("key desired:", key.name, ", key added:", result.username, ", succeeded:", not result.failed, ", fingerprint:", result.fingerprint) self.logger.debug("stderr_out: " + str(result.stderr_out)) @@ -383,7 +381,7 @@ class Actions(object): for g in results: pub_pass = {} for key in results[g]: - self.output('', _unicode_encode(key.pretty_print())) + self.output('', key.pretty_print()) if key.key is "PUB": pub_pass = { @@ -542,7 +540,7 @@ class Actions(object): results[gkey.name] = self.gpg.add_key(gkey) if self.config.options['print_results']: for result in results[gkey.name]: - print("key desired:", _unicode_encode(gkey.name), ", key added:", + print("key desired:", gkey.name, ", key added:", result.username, ", succeeded:", not result.failed, ", fingerprint:", result.fingerprint) self.logger.debug("stderr_out: " + str(result.stderr_out)) @@ -550,7 +548,7 @@ class Actions(object): self.logger.debug("ACTIONS: importkey; result.failed = " + str(result.failed)) failed.append(gkey) if not results[gkey.name][0].failed: - print("Importing: ", _unicode_encode(gkey.name)) + print("Importing: ", gkey.name) self.logger.debug("ACTIONS: importkey; importing key: %s", gkey.name) _keyring = os.path.join(catdir, args.keyring + '.gpg') self.gpg.add_to_keyring(gkey, catdir, _keyring) diff --git a/gkeys/gkeys/base.py b/gkeys/gkeys/base.py index 1a80a03..46f8f2f 100644 --- a/gkeys/gkeys/base.py +++ b/gkeys/gkeys/base.py @@ -17,7 +17,7 @@ from __future__ import print_function import argparse import sys -from pyGPG.status import _unicode_encode +from pyGPG.status import _unicode_decode from gkeys import fileops from gkeys.log import log_levels, set_logger @@ -315,16 +315,16 @@ class CliBase(object): def output_results(results, header=None): # super simple output for the time being if header: - print(_unicode_encode(header)) + print(_unicode_decode(header)) for msg in results: if type(msg) in [str, unicode]: - print(' ', _unicode_encode(msg)) + print(' ', _unicode_decode(msg)) else: try: - print("\n".join([_unicode_encode(x.pretty_print) for x in msg])) + print("\n".join([_unicode_decode(x.pretty_print) for x in msg])) except AttributeError: for x in msg: - print(' ', _unicode_encode(x)) + print(' ', _unicode_decode(x)) print()