From 0a00c6f1d01487299f05da6d6f5dbd9f5ff764f9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 16 Sep 2010 04:09:06 -0700 Subject: Make RepoDisplay __str__ and __unicode__ methods more like DependencyArg. --- pym/_emerge/RepoDisplay.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pym/_emerge/RepoDisplay.py') diff --git a/pym/_emerge/RepoDisplay.py b/pym/_emerge/RepoDisplay.py index f5efd65c8..5a66b5b9c 100644 --- a/pym/_emerge/RepoDisplay.py +++ b/pym/_emerge/RepoDisplay.py @@ -1,8 +1,11 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +import sys + from portage.output import teal from portage import os +from portage import _encodings, _unicode_encode class RepoDisplay(object): def __init__(self, roots): @@ -67,3 +70,10 @@ class RepoDisplay(object): " indicates that the source repository could not be determined\n") return "".join(output) + if sys.hexversion < 0x3000000: + + __unicode__ = __str__ + + def __str__(self): + return _unicode_encode(self.__unicode__(), + encoding=_encodings['content']) -- cgit v1.2.3-1-g7c22