summaryrefslogtreecommitdiffstats
path: root/pym/portage/mail.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/mail.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/mail.py')
-rw-r--r--pym/portage/mail.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pym/portage/mail.py b/pym/portage/mail.py
index 9779fac86..767c66b3f 100644
--- a/pym/portage/mail.py
+++ b/pym/portage/mail.py
@@ -8,6 +8,7 @@ from email.MIMEText import MIMEText as TextMessage
from email.MIMEMultipart import MIMEMultipart as MultipartMessage
from email.MIMEBase import MIMEBase as BaseMessage
from email.header import Header
+from portage.localization import _
def create_message(sender, recipient, subject, body, attachments=None):
@@ -34,7 +35,7 @@ def create_message(sender, recipient, subject, body, attachments=None):
x = x.encode('utf_8', 'replace')
mymessage.attach(TextMessage(x))
else:
- raise portage.exception.PortageException("Can't handle type of attachment: %s" % type(x))
+ raise portage.exception.PortageException(_("Can't handle type of attachment: %s") % type(x))
mymessage.set_unixfrom(sender)
mymessage["To"] = recipient
@@ -68,7 +69,7 @@ def send_mail(mysettings, message):
try:
mymailuser,mymailpasswd = myauthdata.split(":")
except ValueError:
- print "!!! invalid SMTP AUTH configuration, trying unauthenticated ..."
+ print _("!!! invalid SMTP AUTH configuration, trying unauthenticated ...")
else:
myconndata = mymailuri
if ":" in myconndata:
@@ -99,14 +100,14 @@ def send_mail(mysettings, message):
fd = os.popen(mymailhost+" -f "+myfrom+" "+myrecipient, "w")
fd.write(message.as_string())
if fd.close() != None:
- sys.stderr.write("!!! %s returned with a non-zero exit code. This generally indicates an error.\n" % mymailhost)
+ sys.stderr.write(_("!!! %s returned with a non-zero exit code. This generally indicates an error.\n") % mymailhost)
else:
try:
if int(mymailport) > 100000:
myconn = smtplib.SMTP(mymailhost, int(mymailport) - 100000)
myconn.ehlo()
if not myconn.has_extn("STARTTLS"):
- raise portage.exception.PortageException("!!! TLS support requested for logmail but not suported by server")
+ raise portage.exception.PortageException(_("!!! TLS support requested for logmail but not suported by server"))
myconn.starttls()
myconn.ehlo()
else:
@@ -116,8 +117,8 @@ def send_mail(mysettings, message):
myconn.sendmail(myfrom, myrecipient, message.as_string())
myconn.quit()
except smtplib.SMTPException, e:
- raise portage.exception.PortageException("!!! An error occured while trying to send logmail:\n"+str(e))
+ raise portage.exception.PortageException(_("!!! An error occured while trying to send logmail:\n")+str(e))
except socket.error, e:
- raise portage.exception.PortageException("!!! A network error occured while trying to send logmail:\n"+str(e)+"\nSure you configured PORTAGE_ELOG_MAILURI correctly?")
+ raise portage.exception.PortageException(_("!!! A network error occured while trying to send logmail:\n%s\nSure you configured PORTAGE_ELOG_MAILURI correctly?") % str(e))
return