tree-wide: Make some error messages translatable
This commit is contained in:
+4
-3
@@ -32,13 +32,14 @@ import pisi.context as ctx
|
||||
|
||||
class AlreadyHaveException(pisi.Exception):
|
||||
def __init__(self, url, localfile):
|
||||
pisi.Exception.__init__(self, "URL %s already downloaded as %s" % (url, localfile))
|
||||
pisi.Exception.__init__(self, _("URL %s already downloaded as %s")
|
||||
% (url, localfile))
|
||||
self.url = url
|
||||
self.localfile = localfile
|
||||
|
||||
class NoSignatureFound(pisi.Exception):
|
||||
def __init__(self, url):
|
||||
pisi.Exception.__init__(self, "No signature found for %s" % url)
|
||||
pisi.Exception.__init__(self, _("No signature found for %s") % url)
|
||||
self.url = url
|
||||
|
||||
class Error(pisi.Error):
|
||||
@@ -46,7 +47,7 @@ class Error(pisi.Error):
|
||||
|
||||
class InvalidSignature(pisi.Error):
|
||||
def __init__(self, url):
|
||||
pisi.Exception.__init__(self, " invalid for %s" % url)
|
||||
pisi.Exception.__init__(self, _(" invalid for %s") % url)
|
||||
self.url = url
|
||||
|
||||
class File:
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@ class History(xmlfile.XmlFile):
|
||||
def create(self, operation):
|
||||
|
||||
if operation not in ["upgrade", "remove", "emerge", "install", "snapshot", "takeback", "repoupdate"]:
|
||||
raise Exception("Unknown package operation")
|
||||
raise Exception(_("Unknown package operation"))
|
||||
|
||||
opno = self._get_latest()
|
||||
self.histfile = "%s_%s.xml" % (opno, operation)
|
||||
@@ -119,7 +119,7 @@ class History(xmlfile.XmlFile):
|
||||
def add(self, pkgBefore=None, pkgAfter=None, operation=None, otype=None):
|
||||
|
||||
if operation not in ["upgrade", "remove", "install", "reinstall", "downgrade", "snapshot"]:
|
||||
raise Exception("Unknown package operation")
|
||||
raise Exception(_("Unknown package operation"))
|
||||
|
||||
package = Package()
|
||||
package.operation = operation
|
||||
|
||||
Reference in New Issue
Block a user