[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - MailHost.py:1.70 SendMailTag.py:1.16
Andreas Jung
andreas@digicool.com
Mon, 11 Mar 2002 10:54:38 -0500
Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv21023/MailHost
Modified Files:
MailHost.py SendMailTag.py
Log Message:
string module free zone
=== Zope/lib/python/Products/MailHost/MailHost.py 1.69 => 1.70 ===
from AccessControl.Role import RoleManager
from operator import truth
-import Acquisition, sys, string, types, mimetools
+import Acquisition, sys, types, mimetools
import OFS.SimpleItem, re, quopri, rfc822
from cStringIO import StringIO
from AccessControl import ClassSecurityInfo
@@ -84,7 +84,7 @@
title=str(title)
smtp_host=str(smtp_host)
if type(smtp_port) is not type(1):
- smtp_port=string.atoi(smtp_port)
+ smtp_port=int(smtp_port)
self.title=title
self.smtp_host=smtp_host
@@ -142,7 +142,7 @@
if mto:
if type(mto) is type('s'):
- mto=map(string.strip, string.split(mto,','))
+ mto=[ x.strip() for x in mto.split(',')]
headers['to'] = filter(None, mto)
if mfrom:
headers['from'] = mfrom
@@ -169,7 +169,7 @@
messageText)
if mto:
if type(mto) is type('s'):
- mto=map(string.strip, string.split(mto,','))
+ mto=[ x.strip() for x in mto.split(',')]
headers['to'] = filter(truth, mto)
if mfrom:
headers['from'] = mfrom
@@ -215,7 +215,7 @@
if mo.getencoding() != '7bit':
raise MailHostError, 'Message already encoded'
newmfile=StringIO()
- newmfile.write(string.joinfields(mo.headers, ''))
+ newmfile.write(''.join(mo.headers))
newmfile.write('Content-Transfer-Encoding: %s\n' % encode)
if not mo.has_key('Mime-Version'):
newmfile.write('Mime-Version: 1.0\n')
@@ -226,7 +226,7 @@
def extractheaders(message):
# return headers of message
- mfile=StringIO(string.strip(message))
+ mfile=StringIO(message.strip())
mo=rfc822.Message(mfile)
hd={}
=== Zope/lib/python/Products/MailHost/SendMailTag.py 1.15 => 1.16 ===
from DocumentTemplate.DT_String import String
from socket import gethostname
-import string
class SendMailTag:
'''the send mail tag, used like thus:
@@ -93,7 +92,7 @@
self.mailfrom=args['mailfrom']
self.subject=None or args['subject']
if args['port'] and type(args['port']) is type('s'):
- self.port=args['port']=string.atoi(args['port'])
+ self.port=args['port']=int(args['port'])
elif args['port']=='':
self.port=args['port']=25
else: