[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/app/mail/
Remove zope.app.mail dependencies on zope.app
Brian Sutherland
jinty at web.de
Tue Apr 11 16:37:35 EDT 2006
Log message for revision 66864:
Remove zope.app.mail dependencies on zope.app
Changed:
U Zope3/branches/jim-adapter/src/zope/app/mail/interfaces.py
U Zope3/branches/jim-adapter/src/zope/app/mail/maildir.py
U Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/mail/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/mail/interfaces.py 2006-04-11 20:21:53 UTC (rev 66863)
+++ Zope3/branches/jim-adapter/src/zope/app/mail/interfaces.py 2006-04-11 20:37:34 UTC (rev 66864)
@@ -57,7 +57,8 @@
from zope.interface import Interface, Attribute
from zope.schema import Object, TextLine, Int, Password, BytesLine
-from zope.app.i18n import ZopeMessageFactory as _
+from zope.i18nmessageid import MessageFactory
+_ = MessageFactory('zope')
class IMailDelivery(Interface):
Modified: Zope3/branches/jim-adapter/src/zope/app/mail/maildir.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/mail/maildir.py 2006-04-11 20:21:53 UTC (rev 66863)
+++ Zope3/branches/jim-adapter/src/zope/app/mail/maildir.py 2006-04-11 20:37:34 UTC (rev 66864)
@@ -27,13 +27,13 @@
IMaildirFactory, IMaildir, IMaildirMessageWriter
class Maildir(object):
- """See `zope.app.interfaces.mail.IMaildir`"""
+ """See `zope.mail.interfaces.IMaildir`"""
classProvides(IMaildirFactory)
implements(IMaildir)
def __init__(self, path, create=False):
- "See `zope.app.interfaces.mail.IMaildirFactory`"
+ "See `zope.mail.interfaces.IMaildirFactory`"
self.path = path
def access(path):
@@ -56,7 +56,7 @@
raise ValueError('%s is not a Maildir folder' % path)
def __iter__(self):
- "See `zope.app.interfaces.mail.IMaildir`"
+ "See `zope.mail.interfaces.IMaildir`"
join = os.path.join
subdir_cur = join(self.path, 'cur')
subdir_new = join(self.path, 'new')
@@ -71,7 +71,7 @@
return iter(new_messages + cur_messages)
def newMessage(self):
- "See `zope.app.interfaces.mail.IMaildir`"
+ "See `zope.mail.interfaces.IMaildir`"
# NOTE: http://www.qmail.org/man/man5/maildir.html says, that the first
# step of the delivery process should be a chdir. Chdirs and
# threading do not mix. Is that chdir really necessary?
@@ -98,7 +98,7 @@
class MaildirMessageWriter(object):
- """See `zope.app.interfaces.mail.IMaildirMessageWriter`"""
+ """See `zope.mail.interfaces.IMaildirMessageWriter`"""
implements(IMaildirMessageWriter)
Modified: Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py 2006-04-11 20:21:53 UTC (rev 66863)
+++ Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py 2006-04-11 20:37:34 UTC (rev 66864)
@@ -21,16 +21,15 @@
import threading
import time
+from zope.component
from zope.component.testing import PlacelessSetup
from zope.configuration import xmlconfig
from zope.interface import implements
-from zope.app import zapi
from zope.app.mail.interfaces import \
IMailDelivery, IMailer, ISMTPMailer
from zope.app.mail.delivery import QueueProcessorThread
from zope.app.mail import delivery
-from zope.app.testing import ztapi
import zope.app.mail.tests
@@ -58,8 +57,9 @@
super(DirectivesTest, self).setUp()
self.testMailer = Mailer()
- ztapi.provideUtility(IMailer, Mailer(), name="test.smtp")
- ztapi.provideUtility(IMailer, self.testMailer, name="test.mailer")
+ gsm = zope.component.getGlobalSiteManager()
+ gsm.registerUtility(IMailer, Mailer(), "test.smtp")
+ gsm.registerUtility(IMailer, self.testMailer, "test.mailer")
self.context = xmlconfig.file("mail.zcml", zope.app.mail.tests)
self.orig_maildir = delivery.Maildir
@@ -80,17 +80,17 @@
shutil.rmtree(self.mailbox, True)
def testQueuedDelivery(self):
- delivery = zapi.getUtility(IMailDelivery, "Mail")
+ delivery = zope.component.getUtility(IMailDelivery, "Mail")
self.assertEqual('QueuedMailDelivery', delivery.__class__.__name__)
self.assertEqual(self.mailbox, delivery.queuePath)
def testDirectDelivery(self):
- delivery = zapi.getUtility(IMailDelivery, "Mail2")
+ delivery = zope.componenet.getUtility(IMailDelivery, "Mail2")
self.assertEqual('DirectMailDelivery', delivery.__class__.__name__)
self.assert_(self.testMailer is delivery.mailer)
def testSMTPMailer(self):
- mailer = zapi.getUtility(IMailer, "smtp")
+ mailer = zope.component.getUtility(IMailer, "smtp")
self.assert_(ISMTPMailer.providedBy(mailer))
More information about the Zope3-Checkins
mailing list