summaryrefslogtreecommitdiffstats
path: root/pym/portage/glsa.py
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-15 18:13:18 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-15 18:13:18 +0000
commit74ecc5568944b42e38cd99a4c07a6249bc9a56ed (patch)
tree4afdd58d9462b0d2efe71edfa43810e42766b5d2 /pym/portage/glsa.py
parent6a454b2769795983b0f91d341632782b2596ef0b (diff)
downloadportage-74ecc5568944b42e38cd99a4c07a6249bc9a56ed.tar.gz
portage-74ecc5568944b42e38cd99a4c07a6249bc9a56ed.tar.bz2
portage-74ecc5568944b42e38cd99a4c07a6249bc9a56ed.zip
Prepare 308 messages to localization.
svn path=/main/trunk/; revision=14067
Diffstat (limited to 'pym/portage/glsa.py')
-rw-r--r--pym/portage/glsa.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py
index a16b98c2c..008cb86dc 100644
--- a/pym/portage/glsa.py
+++ b/pym/portage/glsa.py
@@ -11,6 +11,7 @@ import xml.dom.minidom
from portage.versions import pkgsplit, catpkgsplit, pkgcmp, best
from portage.util import grabfile
from portage.const import CACHE_PATH
+from portage.localization import _
# Note: the space for rgt and rlt is important !!
# FIXME: use slot deps instead, requires GLSA format versioning
@@ -185,7 +186,7 @@ def getText(node, format):
elif subnode.nodeName == "#text":
rValue += subnode.data
else:
- raise GlsaFormatException("Invalid Tag found: ", subnode.nodeName)
+ raise GlsaFormatException(_("Invalid Tag found: "), subnode.nodeName)
if format == "strip":
rValue = rValue.strip(" \n\t")
rValue = re.sub("[\s]{2,}", " ", rValue)
@@ -439,7 +440,7 @@ class Glsa:
elif os.path.exists(myid):
self.type = "file"
else:
- raise GlsaArgumentException("Given ID "+myid+" isn't a valid GLSA ID or filename.")
+ raise GlsaArgumentException(_("Given ID %s isn't a valid GLSA ID or filename.") % myid)
self.nr = myid
self.config = myconfig
self.vardbapi = vardbapi
@@ -487,7 +488,7 @@ class Glsa:
raise GlsaTypeException(self.DOM.doctype.systemId)
myroot = self.DOM.getElementsByTagName("glsa")[0]
if self.type == "id" and myroot.getAttribute("id") != self.nr:
- raise GlsaFormatException("filename and internal id don't match:" + myroot.getAttribute("id") + " != " + self.nr)
+ raise GlsaFormatException(_("filename and internal id don't match:") + myroot.getAttribute("id") + " != " + self.nr)
# the simple (single, required, top-level, #PCDATA) tags first
self.title = getText(myroot.getElementsByTagName("title")[0], format="strip")
@@ -510,7 +511,7 @@ class Glsa:
try:
self.count = int(count)
except ValueError:
- # TODO should this rais a GlsaFormatException?
+ # TODO should this raise a GlsaFormatException?
self.count = 1
# now the optional and 0-n toplevel, #PCDATA tags and references
@@ -566,27 +567,27 @@ class Glsa:
width = 76
outstream.write(("GLSA %s: \n%s" % (self.nr, self.title)).center(width)+"\n")
outstream.write((width*"=")+"\n")
- outstream.write(wrap(self.synopsis, width, caption="Synopsis: ")+"\n")
- outstream.write("Announced on: %s\n" % self.announced)
- outstream.write("Last revised on: %s : %02d\n\n" % (self.revised, self.count))
+ outstream.write(wrap(self.synopsis, width, caption=_("Synopsis: "))+"\n")
+ outstream.write(_("Announced on: %s\n") % self.announced)
+ outstream.write(_("Last revised on: %s : %02d\n\n") % (self.revised, self.count))
if self.glsatype == "ebuild":
for k in self.packages.keys():
pkg = self.packages[k]
for path in pkg:
vul_vers = "".join(path["vul_vers"])
unaff_vers = "".join(path["unaff_vers"])
- outstream.write("Affected package: %s\n" % k)
- outstream.write("Affected archs: ")
+ outstream.write(_("Affected package: %s\n") % k)
+ outstream.write(_("Affected archs: "))
if path["arch"] == "*":
- outstream.write("All\n")
+ outstream.write(_("All\n"))
else:
outstream.write("%s\n" % path["arch"])
- outstream.write("Vulnerable: %s\n" % vul_vers)
- outstream.write("Unaffected: %s\n\n" % unaff_vers)
+ outstream.write(_("Vulnerable: %s\n") % vul_vers)
+ outstream.write(_("Unaffected: %s\n\n") % unaff_vers)
elif self.glsatype == "infrastructure":
pass
if len(self.bugs) > 0:
- outstream.write("\nRelated bugs: ")
+ outstream.write(_("\nRelated bugs: "))
for i in range(0, len(self.bugs)):
outstream.write(self.bugs[i])
if i < len(self.bugs)-1:
@@ -594,15 +595,15 @@ class Glsa:
else:
outstream.write("\n")
if self.background:
- outstream.write("\n"+wrap(self.background, width, caption="Background: "))
- outstream.write("\n"+wrap(self.description, width, caption="Description: "))
- outstream.write("\n"+wrap(self.impact_text, width, caption="Impact: "))
- outstream.write("\n"+wrap(self.workaround, width, caption="Workaround: "))
- outstream.write("\n"+wrap(self.resolution, width, caption="Resolution: "))
+ outstream.write("\n"+wrap(self.background, width, caption=_("Background: ")))
+ outstream.write("\n"+wrap(self.description, width, caption=_("Description: ")))
+ outstream.write("\n"+wrap(self.impact_text, width, caption=_("Impact: ")))
+ outstream.write("\n"+wrap(self.workaround, width, caption=_("Workaround: ")))
+ outstream.write("\n"+wrap(self.resolution, width, caption=_("Resolution: ")))
myreferences = ""
for r in self.references:
myreferences += (r.replace(" ", SPACE_ESCAPE)+NEWLINE_ESCAPE+" ")
- outstream.write("\n"+wrap(myreferences, width, caption="References: "))
+ outstream.write("\n"+wrap(myreferences, width, caption=_("References: ")))
outstream.write("\n")
def isVulnerable(self):