Lines 1-4
Link Here
|
1 |
# Copyright 1998-2004 Gentoo Foundation |
1 |
# Copyright 1998-2011 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
3 |
|
4 |
import signal |
4 |
import signal |
Lines 150-162
class UnsupportedAPIException(PortagePackageException):
Link Here
|
150 |
def __init__(self, cpv, eapi): |
150 |
def __init__(self, cpv, eapi): |
151 |
self.cpv, self.eapi = cpv, eapi |
151 |
self.cpv, self.eapi = cpv, eapi |
152 |
def __str__(self): |
152 |
def __str__(self): |
|
|
153 |
eapi = self.eapi |
154 |
if not isinstance(eapi, basestring): |
155 |
eapi = str(eapi) |
156 |
eapi = eapi.lstrip("-") |
153 |
msg = _("Unable to do any operations on '%(cpv)s', since " |
157 |
msg = _("Unable to do any operations on '%(cpv)s', since " |
154 |
"its EAPI is higher than this portage version's. Please upgrade" |
158 |
"its EAPI is higher than this portage version's. Please upgrade" |
155 |
" to a portage version that supports EAPI '%(eapi)s'.") % \ |
159 |
" to a portage version that supports EAPI '%(eapi)s'.") % \ |
156 |
{"cpv": self.cpv, "eapi": str(self.eapi).lstrip("-")} |
160 |
{"cpv": self.cpv, "eapi": eapi} |
157 |
return msg |
161 |
return _unicode_decode(msg, |
|
|
162 |
encoding=_encodings['content'], errors='replace') |
158 |
|
163 |
|
|
|
164 |
if sys.hexversion < 0x3000000: |
165 |
|
166 |
__unicode__ = __str__ |
159 |
|
167 |
|
|
|
168 |
def __str__(self): |
169 |
return _unicode_encode(self.__unicode__(), |
170 |
encoding=_encodings['content'], errors='backslashreplace') |
160 |
|
171 |
|
161 |
class SignatureException(PortageException): |
172 |
class SignatureException(PortageException): |
162 |
"""Signature was not present in the checked file""" |
173 |
"""Signature was not present in the checked file""" |