[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/ Use new import location for zope.app.mail in bugtracker and zwiki

Philipp von Weitershausen philikon at philikon.de
Wed Apr 12 19:44:35 EDT 2006


Log message for revision 66924:
  Use new import location for zope.app.mail in bugtracker and zwiki
  

Changed:
  U   Zope3/branches/jim-adapter/src/bugtracker/mail.py
  U   Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py
  U   Zope3/branches/jim-adapter/src/zwiki/tests/test_wikimail.py
  U   Zope3/branches/jim-adapter/src/zwiki/wikipage.py

-=-
Modified: Zope3/branches/jim-adapter/src/bugtracker/mail.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/mail.py	2006-04-12 23:37:35 UTC (rev 66923)
+++ Zope3/branches/jim-adapter/src/bugtracker/mail.py	2006-04-12 23:44:34 UTC (rev 66924)
@@ -15,15 +15,14 @@
 
 $Id$
 """
+import zope.component
 from zope.interface import implements
 from zope.annotation.interfaces import IAnnotations
 from zope.lifecycleevent.interfaces import IObjectCreatedEvent, IObjectModifiedEvent
+from zope.sendmail.interfaces import IMailDelivery
+from zope.traversing.api import getName, getParent
+from bugtracker.interfaces import IBug, IBugTracker, IMailSubscriptions
 
-from zope.app import zapi
-from zope.app.mail.interfaces import IMailDelivery
-
-from interfaces import IBug, IBugTracker, IMailSubscriptions
-
 SubscriberKey = 'bugtracker.MailSubsriptions.emails'
 
 class MailSubscriptions:
@@ -70,19 +69,19 @@
                 self.handleModified(event.object)
 
     def handleAdded(self, object):
-        subject = 'Added: %s (%s)' %(object.title, zapi.name(object))
+        subject = 'Added: %s (%s)' %(object.title, getName(object))
         emails = self.getAllSubscribers(object)
         body = object.description
         self.mail(emails, subject, body)        
 
     def handleModified(self, object):
-        subject = 'Modified: %s (%s)' %(object.title, zapi.name(object))
+        subject = 'Modified: %s (%s)' %(object.title, getName(object))
         emails = self.getAllSubscribers(object)
         body = object.description
         self.mail(emails, subject, body)
 
     def handleRemoved(self, object):
-        subject = 'Removed: %s (%s)' %(object.title, zapi.name(object))
+        subject = 'Removed: %s (%s)' %(object.title, getName(object))
         emails = self.getAllSubscribers(object)
         body = object.description
         self.mail(emails, subject, body)
@@ -93,7 +92,7 @@
         obj = object
         while IBug.providedBy(obj) or IBugTracker.providedBy(obj):
             emails += tuple(IMailSubscriptions(obj).getSubscriptions())
-            obj = zapi.getParent(obj)
+            obj = getParent(obj)
         return emails
 
     def mail(self, toaddrs, subject, body):
@@ -101,5 +100,5 @@
         if not toaddrs:
             return
         msg = 'Subject: %s\n\n\n%s' %(subject, body)
-        mail_utility = zapi.getUtility(IMailDelivery, 'bug-mailer')
+        mail_utility = zope.component.getUtility(IMailDelivery, 'bug-mailer')
         mail_utility.send('bugtracker at zope3.org' , toaddrs, msg)

Modified: Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py	2006-04-12 23:37:35 UTC (rev 66923)
+++ Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py	2006-04-12 23:44:34 UTC (rev 66924)
@@ -27,9 +27,9 @@
 from zope.lifecycleevent import ObjectModifiedEvent
 from zope.dublincore.interfaces import IWriteZopeDublinCore
 from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapter
+from zope.sendmail.interfaces import IMailDelivery
 
 from zope.app.testing import ztapi
-from zope.app.mail.interfaces import IMailDelivery
 
 from bugtracker.bug import Bug
 from bugtracker.interfaces import IBug, IBugTracker, IMailSubscriptions

Modified: Zope3/branches/jim-adapter/src/zwiki/tests/test_wikimail.py
===================================================================
--- Zope3/branches/jim-adapter/src/zwiki/tests/test_wikimail.py	2006-04-12 23:37:35 UTC (rev 66923)
+++ Zope3/branches/jim-adapter/src/zwiki/tests/test_wikimail.py	2006-04-12 23:44:34 UTC (rev 66924)
@@ -24,11 +24,11 @@
 from zope.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.annotation.attribute import AttributeAnnotations
 from zope.lifecycleevent import ObjectModifiedEvent
+from zope.sendmail.interfaces import IMailDelivery
 
 from zope.app.testing import ztapi
 from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.mail.interfaces import IMailDelivery
 
 from zwiki.interfaces import IWikiPage, IWiki, IMailSubscriptions
 from zwiki.interfaces import IWikiPageEditEvent

Modified: Zope3/branches/jim-adapter/src/zwiki/wikipage.py
===================================================================
--- Zope3/branches/jim-adapter/src/zwiki/wikipage.py	2006-04-12 23:37:35 UTC (rev 66923)
+++ Zope3/branches/jim-adapter/src/zwiki/wikipage.py	2006-04-12 23:44:34 UTC (rev 66924)
@@ -31,13 +31,13 @@
 from zope.filerepresentation.interfaces import IWriteFile
 from zope.filerepresentation.interfaces import IReadDirectory
 from zope.filerepresentation.interfaces import IWriteDirectory
+from zope.sendmail.interfaces import IMailDelivery
 
 from zope.app import zapi
 from zope.app.container.btree import BTreeContainer
 from zope.app.container.contained import Contained
 from zope.app.container.interfaces import \
      IObjectAddedEvent, IObjectRemovedEvent
-from zope.app.mail.interfaces import IMailDelivery
 
 from zwiki.interfaces import IWiki, IWikiPage
 from zwiki.interfaces import IWikiContained, IWikiPageContained



More information about the Zope3-Checkins mailing list