launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03608
[Merge] lp:~jcsackett/launchpad/apocalyptic-messages-0 into lp:launchpad
j.c.sackett has proposed merging lp:~jcsackett/launchpad/apocalyptic-messages-0 into lp:launchpad with lp:~jcsackett/launchpad/spam-tech-debt as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/apocalyptic-messages-0/+merge/60953
Summary
=======
As part of ongoing work to move the divvied up bits of active modules in canonical to more self-contained modules in lp, this branch moves the various bits of messages into lp.services.messages
This branch was erroneously branched off of the spam-tech-debt branch, not devel. To keep that noise out of the diff, I've set it as a dependent branch, but there are no real dependencies.
Preimplementation
=================
Spoke with Curtis Hovey
Implementation
==============
In summary, a number of files were moved into a new module, lp.services.messages. The remaining files were updated to accomodate these changes.
The following files were moved:
lib/canonical/launchpad/interfaces/message.py => lib/lp/services/messages/interfaces/message.py
lib/caonical/launchpad/database/message.py => lib/lp/services/messages/model/message.py
lib/canonical/launchpad/database/tests/test_message.py => lib/lp/services/messages/tests/test_messages.py
lib/canonical/launchpad/doc/message.txt => lib/lp/services/messages/doc/message.txt
lib/canonical/launchpad/zcml/message.zcml => lib/lp/services/messages/configure.zcml
lib/lp/services/messages/tests/test_doc.py was added to link the new doc file to the test suite.
__init__.py files have been added as necessary to facilitate legal imports.
A vast number of lines in txt, zcml, and py files have been updated to use the new paths.
Tests
=====
In truth, the entire testsuite, which is currently running on ec2.
For a quick check:
{{{
bin/test -vvct message
}}}
QA
==
I believe this is qa-untestable. If ec2 doesn't explode horribly on a run all should be well.
Lint
====
Owing to the huge number of changes, linting is difficult if not outright impossible. I believe this branch introduces no new lint.
--
https://code.launchpad.net/~jcsackett/launchpad/apocalyptic-messages-0/+merge/60953
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/apocalyptic-messages-0 into lp:launchpad.
=== modified file 'lib/canonical/launchpad/browser/message.py'
--- lib/canonical/launchpad/browser/message.py 2011-03-27 16:03:44 +0000
+++ lib/canonical/launchpad/browser/message.py 2011-05-13 17:24:28 +0000
@@ -7,7 +7,7 @@
from zope.interface import implements
-from canonical.launchpad.interfaces.message import IIndexedMessage
+from lp.services.messages.interfaces.message import IIndexedMessage
from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
=== modified file 'lib/canonical/launchpad/ftests/test_system_documentation.py'
--- lib/canonical/launchpad/ftests/test_system_documentation.py 2011-03-04 17:05:09 +0000
+++ lib/canonical/launchpad/ftests/test_system_documentation.py 2011-05-13 17:24:28 +0000
@@ -205,9 +205,6 @@
# POExport stuff is Zopeless and connects as a different database user.
# poexport-distroseries-(date-)tarball.txt is excluded, since they add
# data to the database as well.
- 'message.txt': LayeredDocFileSuite(
- '../doc/message.txt',
- setUp=setUp, tearDown=tearDown, layer=LaunchpadFunctionalLayer),
'close-account.txt': LayeredDocFileSuite(
'../doc/close-account.txt', setUp=setUp, tearDown=tearDown,
layer=LaunchpadZopelessLayer),
=== modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py'
--- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-04-12 13:43:36 +0000
+++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-05-13 17:24:28 +0000
@@ -31,7 +31,7 @@
patch_reference_property,
)
from canonical.launchpad.interfaces.emailaddress import IEmailAddress
-from canonical.launchpad.interfaces.message import (
+from lp.services.messages.interfaces.message import (
IIndexedMessage,
IMessage,
IUserToUserEmail,
=== modified file 'lib/canonical/launchpad/interfaces/webservice.py'
--- lib/canonical/launchpad/interfaces/webservice.py 2010-11-09 16:25:22 +0000
+++ lib/canonical/launchpad/interfaces/webservice.py 2011-05-13 17:24:28 +0000
@@ -21,7 +21,7 @@
from canonical.launchpad.interfaces.launchpad import IWebServiceApplication
from canonical.launchpad.interfaces.emailaddress import IEmailAddress
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from canonical.launchpad.interfaces.temporaryblobstorage import (
ITemporaryBlobStorage,
ITemporaryStorageManager,
=== modified file 'lib/canonical/launchpad/mail/commands.py'
--- lib/canonical/launchpad/mail/commands.py 2011-03-28 17:25:43 +0000
+++ lib/canonical/launchpad/mail/commands.py 2011-05-13 17:24:28 +0000
@@ -36,7 +36,7 @@
IBugTaskEditEmailCommand,
IBugTaskEmailCommand,
)
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.mail.helpers import (
get_error_message,
get_person_or_team,
=== modified file 'lib/canonical/launchpad/scripts/debsync.py'
--- lib/canonical/launchpad/scripts/debsync.py 2011-02-17 17:02:54 +0000
+++ lib/canonical/launchpad/scripts/debsync.py 2011-05-13 17:24:28 +0000
@@ -18,7 +18,7 @@
from canonical.database.sqlbase import flush_database_updates
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
-from canonical.launchpad.interfaces.message import (
+from lp.services.messages.interfaces.message import (
IMessageSet,
InvalidEmailMessage,
UnknownSender,
=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2011-05-03 04:39:43 +0000
+++ lib/canonical/launchpad/security.py 2011-05-13 17:24:28 +0000
@@ -26,7 +26,7 @@
from canonical.launchpad.interfaces.librarian import (
ILibraryFileAliasWithParent,
)
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from canonical.launchpad.interfaces.oauth import (
IOAuthAccessToken,
IOAuthRequestToken,
=== modified file 'lib/canonical/launchpad/zcml/configure.zcml'
--- lib/canonical/launchpad/zcml/configure.zcml 2011-03-04 17:05:09 +0000
+++ lib/canonical/launchpad/zcml/configure.zcml 2011-05-13 17:24:28 +0000
@@ -21,7 +21,6 @@
<include file="lifecycle.zcml" />
<include file="logintoken.zcml" />
<include file="marketing.zcml" />
- <include file="message.zcml" />
<include file="oauth.zcml" />
<include file="openidconsumer.zcml" />
<include file="packagecopyrequest.zcml" />
=== modified file 'lib/lp/answers/doc/notifications.txt'
--- lib/lp/answers/doc/notifications.txt 2011-05-09 16:35:10 +0000
+++ lib/lp/answers/doc/notifications.txt 2011-05-13 17:24:28 +0000
@@ -380,7 +380,7 @@
display.)
>>> login('test@xxxxxxxxxxxxx')
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> email_msg = getUtility(IMessageSet).fromText(
... subject=(
... "Re: [Question %d]: Installer doesn't work on "
=== modified file 'lib/lp/answers/doc/workflow.txt'
--- lib/lp/answers/doc/workflow.txt 2011-05-09 16:35:10 +0000
+++ lib/lp/answers/doc/workflow.txt 2011-05-13 17:24:28 +0000
@@ -739,7 +739,7 @@
In all the workflow methods, it is possible to pass an IMessage instead of
a string.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> login('test@xxxxxxxxxxxxx')
>>> messageset = getUtility(IMessageSet)
>>> question = ubuntu.newQuestion(**new_question_args)
=== modified file 'lib/lp/answers/interfaces/questionmessage.py'
--- lib/lp/answers/interfaces/questionmessage.py 2011-04-27 16:42:38 +0000
+++ lib/lp/answers/interfaces/questionmessage.py 2011-05-13 17:24:28 +0000
@@ -19,7 +19,7 @@
)
from canonical.launchpad import _
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.answers.enums import (
QuestionAction,
QuestionStatus,
=== modified file 'lib/lp/answers/mail/handler.py'
--- lib/lp/answers/mail/handler.py 2011-04-26 15:44:26 +0000
+++ lib/lp/answers/mail/handler.py 2011-05-13 17:24:28 +0000
@@ -14,7 +14,7 @@
from zope.interface import implements
from canonical.launchpad.interfaces.mail import IMailHandler
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp.interfaces import ILaunchBag
from lp.answers.interfaces.questioncollection import IQuestionSet
from lp.answers.enums import QuestionStatus
=== modified file 'lib/lp/answers/model/question.py'
--- lib/lp/answers/model/question.py 2011-05-13 04:12:27 +0000
+++ lib/lp/answers/model/question.py 2011-05-13 17:24:28 +0000
@@ -60,13 +60,13 @@
SQLBase,
sqlvalues,
)
-from canonical.launchpad.database.message import (
+from lp.services.messages.model.message import (
Message,
MessageChunk,
)
from canonical.launchpad.helpers import is_english_variant
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.answers.interfaces.faq import IFAQ
from lp.answers.interfaces.question import (
InvalidQuestionStateError,
=== modified file 'lib/lp/answers/model/questionmessage.py'
--- lib/lp/answers/model/questionmessage.py 2011-04-27 16:42:38 +0000
+++ lib/lp/answers/model/questionmessage.py 2011-05-13 17:24:28 +0000
@@ -17,7 +17,7 @@
from canonical.database.enumcol import EnumCol
from canonical.database.sqlbase import SQLBase
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.answers.enums import (
QuestionAction,
QuestionStatus,
=== modified file 'lib/lp/blueprints/interfaces/specificationmessage.py'
--- lib/lp/blueprints/interfaces/specificationmessage.py 2010-08-20 20:31:18 +0000
+++ lib/lp/blueprints/interfaces/specificationmessage.py 2011-05-13 17:24:28 +0000
@@ -18,7 +18,7 @@
Int,
)
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.blueprints.interfaces.specification import ISpecification
=== modified file 'lib/lp/blueprints/model/specificationmessage.py'
--- lib/lp/blueprints/model/specificationmessage.py 2010-08-20 20:31:18 +0000
+++ lib/lp/blueprints/model/specificationmessage.py 2011-05-13 17:24:28 +0000
@@ -17,7 +17,7 @@
from zope.interface import implements
from canonical.database.sqlbase import SQLBase
-from canonical.launchpad.database.message import (
+from lp.services.messages.model.message import (
Message,
MessageChunk,
)
=== modified file 'lib/lp/bugs/browser/tests/test_bugwatch_views.py'
--- lib/lp/bugs/browser/tests/test_bugwatch_views.py 2010-10-04 19:50:45 +0000
+++ lib/lp/bugs/browser/tests/test_bugwatch_views.py 2011-05-13 17:24:28 +0000
@@ -7,7 +7,7 @@
from zope.component import getUtility
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.testing.layers import LaunchpadFunctionalLayer
from lp.testing import login, login_person, TestCaseWithFactory
=== modified file 'lib/lp/bugs/doc/bug.txt'
--- lib/lp/bugs/doc/bug.txt 2011-03-28 20:54:50 +0000
+++ lib/lp/bugs/doc/bug.txt 2011-05-13 17:24:28 +0000
@@ -786,7 +786,7 @@
>>> from lp.bugs.interfaces.bugattachment import IBugAttachmentSet
>>> from canonical.launchpad.interfaces.librarian import (
... ILibraryFileAliasSet)
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> firefox_bug.attachments.count()
0
=== modified file 'lib/lp/bugs/doc/bugattachments.txt'
--- lib/lp/bugs/doc/bugattachments.txt 2010-10-19 18:44:31 +0000
+++ lib/lp/bugs/doc/bugattachments.txt 2011-05-13 17:24:28 +0000
@@ -10,7 +10,7 @@
>>> from canonical.launchpad.ftests import login
>>> login("foo.bar@xxxxxxxxxxxxx")
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from lp.bugs.interfaces.bug import IBugSet
>>> from lp.bugs.interfaces.bugattachment import IBugAttachment
>>> from lp.registry.interfaces.person import IPersonSet
=== modified file 'lib/lp/bugs/doc/bugmessage.txt'
--- lib/lp/bugs/doc/bugmessage.txt 2011-02-10 01:18:39 +0000
+++ lib/lp/bugs/doc/bugmessage.txt 2011-05-13 17:24:28 +0000
@@ -127,7 +127,7 @@
CVE watches and bug watches are also created, when a message is imported from
an external bug tracker.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> message = getUtility(IMessageSet).fromText(
... 'subject',
... """This is a comment from an external tracker. It has a link
=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
--- lib/lp/bugs/doc/bugnotification-sending.txt 2011-04-21 04:36:16 +0000
+++ lib/lp/bugs/doc/bugnotification-sending.txt 2011-05-13 17:24:28 +0000
@@ -45,7 +45,7 @@
Anyway, let's start our demonstration by adding a comment to a bug:
>>> login('test@xxxxxxxxxxxxx')
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from lp.bugs.interfaces.bug import IBugSet
>>> bug_one = getUtility(IBugSet).get(1)
>>> sample_person = getUtility(ILaunchBag).user
=== modified file 'lib/lp/bugs/doc/bugnotification-threading.txt'
--- lib/lp/bugs/doc/bugnotification-threading.txt 2011-02-16 02:43:43 +0000
+++ lib/lp/bugs/doc/bugnotification-threading.txt 2011-05-13 17:24:28 +0000
@@ -10,13 +10,13 @@
Let's add add change notification and see how it works:
>>> from canonical.database.sqlbase import flush_database_updates
- >>> from canonical.launchpad.database.message import MessageSet
+ >>> from lp.services.messages.model.message import MessageSet
>>> login('test@xxxxxxxxxxxxx')
>>> import pytz
>>> from datetime import datetime, timedelta
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from lp.bugs.interfaces.bug import IBugSet
>>> from lp.bugs.adapters.bugchange import BugVisibilityChange
=== modified file 'lib/lp/bugs/doc/bugtask-search.txt'
--- lib/lp/bugs/doc/bugtask-search.txt 2011-02-25 03:58:02 +0000
+++ lib/lp/bugs/doc/bugtask-search.txt 2011-05-13 17:24:28 +0000
@@ -741,7 +741,7 @@
>>> from StringIO import StringIO
>>> from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from lp.bugs.interfaces.bugattachment import (
... BugAttachmentType,
... IBugAttachmentSet,
=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-imports.txt'
--- lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2011-03-29 03:36:53 +0000
+++ lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2011-05-13 17:24:28 +0000
@@ -10,7 +10,7 @@
>>> from canonical.config import config
>>> from lp.bugs.tests.externalbugtracker import (
... new_bugtracker)
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from lp.testing.dbuser import lp_dbuser
>>> from lp.bugs.interfaces.bug import CreateBugParams
>>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt'
--- lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2010-12-14 16:40:16 +0000
+++ lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2011-05-13 17:24:28 +0000
@@ -10,7 +10,7 @@
>>> from canonical.config import config
>>> from lp.bugs.tests.externalbugtracker import (
... new_bugtracker)
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from canonical.testing.layers import LaunchpadZopelessLayer
>>> from lp.bugs.interfaces.bug import CreateBugParams
>>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
=== modified file 'lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt'
--- lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2011-03-09 05:50:48 +0000
+++ lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2011-05-13 17:24:28 +0000
@@ -485,7 +485,7 @@
To demonstrate this method, we'll create a comment to push.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> with lp_dbuser():
... message = getUtility(IMessageSet).fromText(
... "A subject", "An example comment to push.", poster)
=== modified file 'lib/lp/bugs/externalbugtracker/bugzilla.py'
--- lib/lp/bugs/externalbugtracker/bugzilla.py 2011-03-23 16:28:51 +0000
+++ lib/lp/bugs/externalbugtracker/bugzilla.py 2011-05-13 17:24:28 +0000
@@ -24,7 +24,7 @@
from zope.interface import implements
from canonical.config import config
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp.url import (
urlappend,
urlparse,
=== modified file 'lib/lp/bugs/externalbugtracker/debbugs.py'
--- lib/lp/bugs/externalbugtracker/debbugs.py 2011-03-11 03:19:07 +0000
+++ lib/lp/bugs/externalbugtracker/debbugs.py 2011-05-13 17:24:28 +0000
@@ -24,7 +24,7 @@
from canonical.config import config
from canonical.database.sqlbase import commit
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.mail import simple_sendmail
from canonical.launchpad.webapp import urlsplit
from lp.bugs.externalbugtracker import (
=== modified file 'lib/lp/bugs/externalbugtracker/trac.py'
--- lib/lp/bugs/externalbugtracker/trac.py 2011-03-11 03:19:07 +0000
+++ lib/lp/bugs/externalbugtracker/trac.py 2011-05-13 17:24:28 +0000
@@ -20,7 +20,7 @@
from zope.interface import implements
from canonical.config import config
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp.url import urlappend
from lp.app.validators.email import valid_email
from lp.bugs.externalbugtracker.base import (
=== modified file 'lib/lp/bugs/interfaces/bug.py'
--- lib/lp/bugs/interfaces/bug.py 2011-05-02 16:09:43 +0000
+++ lib/lp/bugs/interfaces/bug.py 2011-05-13 17:24:28 +0000
@@ -64,7 +64,7 @@
from canonical.launchpad import _
from canonical.launchpad.interfaces.launchpad import IPrivacy
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.app.validators.attachment import attachment_size_constraint
from lp.app.validators.name import bug_name_validator
from lp.app.errors import NotFoundError
=== modified file 'lib/lp/bugs/interfaces/bugattachment.py'
--- lib/lp/bugs/interfaces/bugattachment.py 2010-12-20 17:42:47 +0000
+++ lib/lp/bugs/interfaces/bugattachment.py 2011-05-13 17:24:28 +0000
@@ -38,7 +38,7 @@
from canonical.launchpad import _
from canonical.launchpad.interfaces.launchpad import IHasBug
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.services.fields import Title
=== modified file 'lib/lp/bugs/interfaces/bugmessage.py'
--- lib/lp/bugs/interfaces/bugmessage.py 2011-04-07 22:32:52 +0000
+++ lib/lp/bugs/interfaces/bugmessage.py 2011-05-13 17:24:28 +0000
@@ -27,7 +27,7 @@
)
from canonical.launchpad.interfaces.launchpad import IHasBug
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.app.validators.attachment import attachment_size_constraint
from lp.bugs.interfaces.bug import IBug
from lp.bugs.interfaces.bugwatch import IBugWatch
=== modified file 'lib/lp/bugs/mail/handler.py'
--- lib/lp/bugs/mail/handler.py 2010-12-13 16:01:07 +0000
+++ lib/lp/bugs/mail/handler.py 2011-05-13 17:24:28 +0000
@@ -24,7 +24,7 @@
IBugTaskEmailCommand,
IMailHandler,
)
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.mail.commands import (
BugEmailCommands,
get_error_message,
=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py 2011-05-10 02:23:38 +0000
+++ lib/lp/bugs/model/bug.py 2011-05-13 17:24:28 +0000
@@ -94,7 +94,7 @@
LibraryFileAlias,
LibraryFileContent,
)
-from canonical.launchpad.database.message import (
+from lp.services.messages.model.message import (
Message,
MessageChunk,
MessageSet,
@@ -107,7 +107,7 @@
)
from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
from canonical.launchpad.interfaces.lpstorm import IStore
-from canonical.launchpad.interfaces.message import (
+from lp.services.messages.interfaces.message import (
IMessage,
IndexedMessage,
)
=== modified file 'lib/lp/bugs/model/bugmessage.py'
--- lib/lp/bugs/model/bugmessage.py 2011-04-07 22:32:52 +0000
+++ lib/lp/bugs/model/bugmessage.py 2011-05-13 17:24:28 +0000
@@ -21,7 +21,7 @@
SQLBase,
sqlvalues,
)
-from canonical.launchpad.database.message import (
+from lp.services.messages.model.message import (
Message,
MessageChunk,
)
=== modified file 'lib/lp/bugs/model/bugnotification.py'
--- lib/lp/bugs/model/bugnotification.py 2011-04-05 22:34:35 +0000
+++ lib/lp/bugs/model/bugnotification.py 2011-05-13 17:24:28 +0000
@@ -40,7 +40,7 @@
from canonical.config import config
from canonical.database.datetimecol import UtcDateTimeCol
from canonical.database.enumcol import EnumCol
-from canonical.launchpad.database.message import Message
+from lp.services.messages.model.message import Message
from canonical.database.sqlbase import (
SQLBase,
sqlvalues,
=== modified file 'lib/lp/bugs/model/bugwatch.py'
--- lib/lp/bugs/model/bugwatch.py 2011-02-24 15:30:54 +0000
+++ lib/lp/bugs/model/bugwatch.py 2011-05-13 17:24:28 +0000
@@ -50,7 +50,7 @@
SQLBase,
sqlvalues,
)
-from canonical.launchpad.database.message import Message
+from lp.services.messages.model.message import Message
from canonical.launchpad.helpers import shortlist
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
from canonical.launchpad.interfaces.lpstorm import IStore
=== modified file 'lib/lp/bugs/scripts/bugimport.py'
--- lib/lp/bugs/scripts/bugimport.py 2010-12-16 16:50:59 +0000
+++ lib/lp/bugs/scripts/bugimport.py 2011-05-13 17:24:28 +0000
@@ -39,7 +39,7 @@
from canonical.launchpad.interfaces.emailaddress import IEmailAddressSet
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from lp.bugs.interfaces.bug import CreateBugParams, IBugSet
from lp.bugs.interfaces.bugactivity import IBugActivitySet
from lp.bugs.interfaces.bugattachment import (
=== modified file 'lib/lp/bugs/scripts/bugzilla.py'
--- lib/lp/bugs/scripts/bugzilla.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/scripts/bugzilla.py 2011-05-13 17:24:28 +0000
@@ -33,7 +33,7 @@
from canonical.launchpad.interfaces.emailaddress import IEmailAddressSet
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp import canonical_url
from lp.app.errors import NotFoundError
from lp.bugs.interfaces.bug import (
=== modified file 'lib/lp/bugs/scripts/checkwatches/bugwatchupdater.py'
--- lib/lp/bugs/scripts/checkwatches/bugwatchupdater.py 2011-03-23 16:28:51 +0000
+++ lib/lp/bugs/scripts/checkwatches/bugwatchupdater.py 2011-05-13 17:24:28 +0000
@@ -16,7 +16,7 @@
from canonical.launchpad.helpers import get_email_template
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp.publisher import canonical_url
from lp.app.errors import NotFoundError
from lp.bugs.externalbugtracker.base import BugWatchUpdateError
=== modified file 'lib/lp/bugs/scripts/tests/test_bugnotification.py'
--- lib/lp/bugs/scripts/tests/test_bugnotification.py 2011-05-02 16:53:13 +0000
+++ lib/lp/bugs/scripts/tests/test_bugnotification.py 2011-05-13 17:24:28 +0000
@@ -22,7 +22,7 @@
from canonical.launchpad.ftests import login
from canonical.launchpad.helpers import get_contact_email_addresses
from canonical.launchpad.interfaces.lpstorm import IStore
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.testing.layers import LaunchpadZopelessLayer
from lp.bugs.adapters.bugchange import (
BranchLinkedToBug,
=== modified file 'lib/lp/bugs/security.py'
--- lib/lp/bugs/security.py 2011-04-27 16:14:32 +0000
+++ lib/lp/bugs/security.py 2011-05-13 17:24:28 +0000
@@ -7,7 +7,7 @@
__all__ = []
from canonical.launchpad.interfaces.launchpad import IHasBug
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.app.security import (
AnonymousAuthorization,
AuthorizationBase,
=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt'
--- lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt 2010-10-31 20:18:45 +0000
+++ lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt 2011-05-13 17:24:28 +0000
@@ -234,7 +234,7 @@
>>> from canonical.launchpad.ftests import login, logout
>>> from zope.component import getUtility
>>> from StringIO import StringIO
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from lp.bugs.interfaces.bug import IBugSet
>>> from lp.registry.interfaces.person import IPersonSet
>>> import transaction
=== modified file 'lib/lp/bugs/tests/bugs-emailinterface.txt'
--- lib/lp/bugs/tests/bugs-emailinterface.txt 2011-03-28 17:26:09 +0000
+++ lib/lp/bugs/tests/bugs-emailinterface.txt 2011-05-13 17:24:28 +0000
@@ -275,7 +275,7 @@
>>> process_email(comment_mail)
>>> commit()
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> bug_one = bugset.get(1)
>>> added_message = getUtility(IMessageSet).get('<yada-yada-test1>')[0]
>>> added_message in bug_one.messages
=== modified file 'lib/lp/bugs/tests/test_bugnotification.py'
--- lib/lp/bugs/tests/test_bugnotification.py 2011-05-03 04:34:35 +0000
+++ lib/lp/bugs/tests/test_bugnotification.py 2011-05-13 17:24:28 +0000
@@ -18,7 +18,7 @@
from canonical.config import config
from canonical.database.sqlbase import sqlvalues
-from canonical.launchpad.database.message import MessageSet
+from lp.services.messages.model.message import MessageSet
from canonical.launchpad.ftests import login
from canonical.testing import (
DatabaseFunctionalLayer,
=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
--- lib/lp/code/browser/branchmergeproposal.py 2011-05-03 16:54:31 +0000
+++ lib/lp/code/browser/branchmergeproposal.py 2011-05-13 17:24:28 +0000
@@ -66,7 +66,7 @@
from canonical.config import config
from canonical.launchpad import _
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp import (
canonical_url,
ContextMenu,
=== modified file 'lib/lp/code/browser/tests/test_branchmergeproposal.py'
--- lib/lp/code/browser/tests/test_branchmergeproposal.py 2011-05-03 16:54:31 +0000
+++ lib/lp/code/browser/tests/test_branchmergeproposal.py 2011-05-13 17:24:28 +0000
@@ -24,7 +24,7 @@
from zope.security.interfaces import Unauthorized
from zope.security.proxy import removeSecurityProxy
-from canonical.launchpad.database.message import MessageSet
+from lp.services.messages.model.message import MessageSet
from canonical.launchpad.webapp.interfaces import IPrimaryContext
from canonical.launchpad.webapp.servers import LaunchpadTestRequest
from canonical.launchpad.webapp.testing import verifyObject
=== modified file 'lib/lp/code/configure.zcml'
--- lib/lp/code/configure.zcml 2011-05-09 19:09:44 +0000
+++ lib/lp/code/configure.zcml 2011-05-13 17:24:28 +0000
@@ -291,7 +291,7 @@
<!-- Branch Merge Proposal Jobs -->
<class class="lp.code.model.branchmergeproposaljob.CreateMergeProposalJob">
- <allow interface="canonical.launchpad.interfaces.message.IMessageJob"/>
+ <allow interface="lp.services.messages.interfaces.message.IMessageJob"/>
<allow interface="lp.code.interfaces.branchmergeproposal.ICreateMergeProposalJob"/>
</class>
<securedutility
=== modified file 'lib/lp/code/interfaces/codereviewcomment.py'
--- lib/lp/code/interfaces/codereviewcomment.py 2010-08-20 20:31:18 +0000
+++ lib/lp/code/interfaces/codereviewcomment.py 2011-05-13 17:24:28 +0000
@@ -26,7 +26,7 @@
)
from canonical.launchpad import _
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.code.enums import CodeReviewVote
from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal
from lp.registry.interfaces.person import IPerson
=== modified file 'lib/lp/code/mail/codehandler.py'
--- lib/lp/code/mail/codehandler.py 2010-12-02 16:13:51 +0000
+++ lib/lp/code/mail/codehandler.py 2011-05-13 17:24:28 +0000
@@ -27,7 +27,7 @@
EmailProcessingError,
IMailHandler,
)
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.mail.commands import (
EmailCommand,
EmailCommandCollection,
=== modified file 'lib/lp/code/mail/tests/test_codehandler.py'
--- lib/lp/code/mail/tests/test_codehandler.py 2010-12-14 03:48:06 +0000
+++ lib/lp/code/mail/tests/test_codehandler.py 2011-05-13 17:24:28 +0000
@@ -22,7 +22,7 @@
from zope.security.proxy import removeSecurityProxy
from canonical.config import config
-from canonical.launchpad.database.message import MessageSet
+from lp.services.messages.model.message import MessageSet
from canonical.launchpad.interfaces.mail import (
EmailProcessingError,
IWeaklyAuthenticatedPrincipal,
=== modified file 'lib/lp/code/mail/tests/test_codereviewcomment.py'
--- lib/lp/code/mail/tests/test_codereviewcomment.py 2011-03-07 07:36:38 +0000
+++ lib/lp/code/mail/tests/test_codereviewcomment.py 2011-05-13 17:24:28 +0000
@@ -8,7 +8,7 @@
from zope.component import getUtility
from zope.security.proxy import removeSecurityProxy
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.mail import format_address
from canonical.launchpad.webapp import canonical_url
from canonical.testing.layers import LaunchpadFunctionalLayer
=== modified file 'lib/lp/code/model/branchmergeproposal.py'
--- lib/lp/code/model/branchmergeproposal.py 2011-03-23 16:28:51 +0000
+++ lib/lp/code/model/branchmergeproposal.py 2011-05-13 17:24:28 +0000
@@ -688,7 +688,7 @@
# Until these are moved into the lp module, import here to avoid
# circular dependencies from canonical.launchpad.database.__init__.py
- from canonical.launchpad.database.message import Message, MessageChunk
+ from lp.services.messages.model.message import Message, MessageChunk
msgid = make_msgid('codereview')
message = Message(
parent=parent_message, owner=owner, rfc822msgid=msgid,
=== modified file 'lib/lp/code/model/branchmergeproposaljob.py'
--- lib/lp/code/model/branchmergeproposaljob.py 2011-01-24 20:10:41 +0000
+++ lib/lp/code/model/branchmergeproposaljob.py 2011-05-13 17:24:28 +0000
@@ -62,11 +62,11 @@
from canonical.config import config
from canonical.database.enumcol import EnumCol
-from canonical.launchpad.database.message import (
+from lp.services.messages.model.message import (
MessageJob,
MessageJobAction,
)
-from canonical.launchpad.interfaces.message import IMessageJob
+from lp.services.messages.interfaces.message import IMessageJob
from canonical.launchpad.webapp import errorlog
from canonical.launchpad.webapp.interaction import setupInteraction
from canonical.launchpad.webapp.interfaces import (
=== modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py'
--- lib/lp/code/model/tests/test_branchmergeproposal.py 2011-03-03 21:21:41 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposal.py 2011-05-13 17:24:28 +0000
@@ -27,7 +27,7 @@
from canonical.database.constants import UTC_NOW
from canonical.launchpad.ftests import import_secret_test_key
from canonical.launchpad.interfaces.launchpad import IPrivacy
-from canonical.launchpad.interfaces.message import IMessageJob
+from lp.services.messages.interfaces.message import IMessageJob
from canonical.launchpad.webapp import canonical_url
from canonical.launchpad.webapp.testing import verifyObject
from canonical.testing.layers import (
=== modified file 'lib/lp/code/model/tests/test_codereviewcomment.py'
--- lib/lp/code/model/tests/test_codereviewcomment.py 2010-10-18 03:39:28 +0000
+++ lib/lp/code/model/tests/test_codereviewcomment.py 2011-05-13 17:24:28 +0000
@@ -6,7 +6,7 @@
from textwrap import dedent
import unittest
-from canonical.launchpad.database.message import MessageSet
+from lp.services.messages.model.message import MessageSet
from canonical.testing.layers import (
DatabaseFunctionalLayer,
LaunchpadFunctionalLayer,
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2011-04-29 13:42:29 +0000
+++ lib/lp/registry/browser/person.py 2011-05-13 17:24:28 +0000
@@ -170,7 +170,7 @@
UnknownRecipientError,
)
from canonical.launchpad.interfaces.logintoken import ILoginTokenSet
-from canonical.launchpad.interfaces.message import (
+from lp.services.messages.interfaces.message import (
IDirectEmailAuthorization,
QuotaReachedError,
)
=== modified file 'lib/lp/registry/browser/tests/mailinglist-message-views.txt'
--- lib/lp/registry/browser/tests/mailinglist-message-views.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/registry/browser/tests/mailinglist-message-views.txt 2011-05-13 17:24:28 +0000
@@ -4,7 +4,7 @@
The HeldMessageView formats a held message so that it can be moderated by
the mailing list administrator.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> team, mlist = factory.makeTeamAndMailingList('parrot', 'owner')
=== modified file 'lib/lp/registry/browser/tests/user-to-user-views.txt'
--- lib/lp/registry/browser/tests/user-to-user-views.txt 2010-12-06 23:18:20 +0000
+++ lib/lp/registry/browser/tests/user-to-user-views.txt 2011-05-13 17:24:28 +0000
@@ -55,7 +55,7 @@
# Capture the date of the last contact for later.
>>> from canonical.config import config
- >>> from canonical.launchpad.database.message import UserToUserEmail
+ >>> from lp.services.messages.model.message import UserToUserEmail
>>> from lazr.config import as_timedelta
>>> from storm.locals import Store
>>> first_contact = Store.of(no_priv).find(
=== modified file 'lib/lp/registry/doc/message-holds.txt'
--- lib/lp/registry/doc/message-holds.txt 2010-12-13 21:54:09 +0000
+++ lib/lp/registry/doc/message-holds.txt 2011-05-13 17:24:28 +0000
@@ -20,7 +20,7 @@
When the message is initially held for approval, a message object is
first created.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> message_set = getUtility(IMessageSet)
>>> message = message_set.fromEmail("""\
... From: foo.bar@xxxxxxxxxxxxx
=== modified file 'lib/lp/registry/doc/standing.txt'
--- lib/lp/registry/doc/standing.txt 2010-12-20 21:56:32 +0000
+++ lib/lp/registry/doc/standing.txt 2011-05-13 17:24:28 +0000
@@ -31,7 +31,7 @@
>>> message_ids = message_id_generator()
# A helper for posting messages to a list.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> from email.Utils import formatdate
>>> from lp.registry.interfaces.mailinglist import IMailingListSet
>>> def post_message(from_address, to_team_name):
=== modified file 'lib/lp/registry/doc/user-to-user.txt'
--- lib/lp/registry/doc/user-to-user.txt 2010-10-18 22:24:59 +0000
+++ lib/lp/registry/doc/user-to-user.txt 2011-05-13 17:24:28 +0000
@@ -15,11 +15,11 @@
user-to-user contact form to send Bart a message. Is she allowed to?
# For testing purposes, we can't use the current date and time.
- >>> from canonical.launchpad.database.message import (
+ >>> from lp.services.messages.model.message import (
... utcdatetime_from_field)
>>> date = utcdatetime_from_field('Thu, 25 Sep 2008 15:29:37 +0100')
- >>> from canonical.launchpad.interfaces.message import (
+ >>> from lp.services.messages.interfaces.message import (
... IDirectEmailAuthorization)
>>> IDirectEmailAuthorization(anne)._isAllowedAfter(date)
True
@@ -31,7 +31,7 @@
Launchpad records the event when Anne sends the message to Bart.
- >>> from canonical.launchpad.database.message import UserToUserEmail
+ >>> from lp.services.messages.model.message import UserToUserEmail
>>> from email import message_from_string
>>> contact = UserToUserEmail(message_from_string("""\
@@ -50,7 +50,7 @@
Anne really likes Bart's project, so she sends him another message.
# Use an explicit cutoff date instead of yesterday.
- >>> from canonical.launchpad.database.message import (
+ >>> from lp.services.messages.model.message import (
... utcdatetime_from_field)
>>> after = utcdatetime_from_field('Thu, 25 Sep 2008 15:20:00 +0100')
=== modified file 'lib/lp/registry/interfaces/distroseriesdifferencecomment.py'
--- lib/lp/registry/interfaces/distroseriesdifferencecomment.py 2010-09-29 08:19:42 +0000
+++ lib/lp/registry/interfaces/distroseriesdifferencecomment.py 2011-05-13 17:24:28 +0000
@@ -23,7 +23,7 @@
)
from canonical.launchpad import _
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from lp.registry.interfaces.distroseriesdifference import (
IDistroSeriesDifference,
)
=== modified file 'lib/lp/registry/interfaces/mailinglist.py'
--- lib/lp/registry/interfaces/mailinglist.py 2010-10-26 03:51:12 +0000
+++ lib/lp/registry/interfaces/mailinglist.py 2011-05-13 17:24:28 +0000
@@ -43,7 +43,7 @@
from canonical.launchpad import _
from canonical.launchpad.interfaces.emailaddress import IEmailAddress
from canonical.launchpad.interfaces.librarian import ILibraryFileAlias
-from canonical.launchpad.interfaces.message import IMessage
+from lp.services.messages.interfaces.message import IMessage
from canonical.launchpad.webapp.interfaces import ILaunchpadApplication
from lp.registry.interfaces.person import IPerson
from lp.services.fields import PublicPersonChoice
=== modified file 'lib/lp/registry/mail/notification.py'
--- lib/lp/registry/mail/notification.py 2011-03-10 19:19:48 +0000
+++ lib/lp/registry/mail/notification.py 2011-05-13 17:24:28 +0000
@@ -24,7 +24,7 @@
get_email_template,
)
from canonical.launchpad.interfaces.launchpad import ILaunchpadRoot
-from canonical.launchpad.interfaces.message import (
+from lp.services.messages.interfaces.message import (
IDirectEmailAuthorization,
QuotaReachedError,
)
=== modified file 'lib/lp/registry/model/distroseriesdifference.py'
--- lib/lp/registry/model/distroseriesdifference.py 2011-05-03 07:10:37 +0000
+++ lib/lp/registry/model/distroseriesdifference.py 2011-05-13 17:24:28 +0000
@@ -40,7 +40,7 @@
from canonical.launchpad.components.decoratedresultset import (
DecoratedResultSet,
)
-from canonical.launchpad.database.message import Message
+from lp.services.messages.model.message import Message
from canonical.launchpad.interfaces.lpstorm import (
IMasterStore,
IStore,
=== modified file 'lib/lp/registry/model/distroseriesdifferencecomment.py'
--- lib/lp/registry/model/distroseriesdifferencecomment.py 2010-09-30 07:30:11 +0000
+++ lib/lp/registry/model/distroseriesdifferencecomment.py 2011-05-13 17:24:28 +0000
@@ -21,7 +21,7 @@
implements,
)
-from canonical.launchpad.database.message import Message, MessageChunk
+from lp.services.messages.model.message import Message, MessageChunk
from canonical.launchpad.interfaces.lpstorm import (
IMasterStore,
IStore,
=== modified file 'lib/lp/registry/model/mailinglist.py'
--- lib/lp/registry/model/mailinglist.py 2011-03-25 23:24:06 +0000
+++ lib/lp/registry/model/mailinglist.py 2011-05-13 17:24:28 +0000
@@ -71,7 +71,7 @@
)
from canonical.launchpad.database.account import Account
from canonical.launchpad.database.emailaddress import EmailAddress
-from canonical.launchpad.database.message import Message
+from lp.services.messages.model.message import Message
from canonical.launchpad.interfaces.account import AccountStatus
from canonical.launchpad.interfaces.emailaddress import (
EmailAddressStatus,
=== modified file 'lib/lp/registry/stories/mailinglists/moderation.txt'
--- lib/lp/registry/stories/mailinglists/moderation.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/registry/stories/mailinglists/moderation.txt 2011-05-13 17:24:28 +0000
@@ -58,7 +58,7 @@
and it is held for approval.
>>> login('foo.bar@xxxxxxxxxxxxx')
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> message_set = getUtility(IMessageSet)
>>> message = message_set.fromEmail("""\
... From: carlos@xxxxxxxxxxxxx
=== modified file 'lib/lp/registry/tests/test_mailinglist.py'
--- lib/lp/registry/tests/test_mailinglist.py 2011-01-24 19:12:37 +0000
+++ lib/lp/registry/tests/test_mailinglist.py 2011-05-13 17:24:28 +0000
@@ -8,7 +8,7 @@
from zope.component import getUtility
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.testing.layers import (
DatabaseFunctionalLayer,
LaunchpadFunctionalLayer,
=== modified file 'lib/lp/registry/xmlrpc/mailinglist.py'
--- lib/lp/registry/xmlrpc/mailinglist.py 2011-02-17 17:02:54 +0000
+++ lib/lp/registry/xmlrpc/mailinglist.py 2011-05-13 17:24:28 +0000
@@ -21,7 +21,7 @@
EmailAddressStatus,
IEmailAddressSet,
)
-from canonical.launchpad.interfaces.message import IMessageSet
+from lp.services.messages.interfaces.message import IMessageSet
from canonical.launchpad.webapp import LaunchpadXMLRPCView
from canonical.launchpad.xmlrpc import faults
from lp.registry.interfaces.mailinglist import (
=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py 2011-04-19 00:43:39 +0000
+++ lib/lp/scripts/tests/test_garbo.py 2011-05-13 17:24:28 +0000
@@ -35,7 +35,7 @@
UTC_NOW,
)
from canonical.launchpad.database.librarian import TimeLimitedToken
-from canonical.launchpad.database.message import Message
+from lp.services.messages.model.message import Message
from canonical.launchpad.database.oauth import OAuthNonce
from canonical.launchpad.database.openidconsumer import OpenIDConsumerNonce
from canonical.launchpad.interfaces.emailaddress import EmailAddressStatus
=== modified file 'lib/lp/scripts/utilities/sanitizedb.py'
--- lib/lp/scripts/utilities/sanitizedb.py 2011-03-10 20:47:57 +0000
+++ lib/lp/scripts/utilities/sanitizedb.py 2011-05-13 17:24:28 +0000
@@ -257,7 +257,7 @@
def removePrivateBugMessages(self):
"""Remove all hidden bug messages."""
from lp.bugs.model.bugmessage import BugMessage
- from canonical.launchpad.database.message import Message
+ from lp.services.messages.model.message import Message
message_ids = list(self.store.using(*[
BugMessage,
Join(Message, BugMessage.messageID == Message.id),
=== modified file 'lib/lp/services/configure.zcml'
--- lib/lp/services/configure.zcml 2011-03-08 04:26:42 +0000
+++ lib/lp/services/configure.zcml 2011-05-13 17:24:28 +0000
@@ -18,4 +18,5 @@
<include package=".scripts" />
<include package=".session" />
<include package=".worlddata" />
+ <include package=".messages" />
</configure>
=== added directory 'lib/lp/services/messages'
=== added file 'lib/lp/services/messages/__init__.py'
=== renamed file 'lib/canonical/launchpad/zcml/message.zcml' => 'lib/lp/services/messages/configure.zcml'
--- lib/canonical/launchpad/zcml/message.zcml 2011-03-02 15:34:31 +0000
+++ lib/lp/services/messages/configure.zcml 2011-05-13 17:24:28 +0000
@@ -10,32 +10,32 @@
<!-- Message -->
<class
- class="canonical.launchpad.database.message.Message">
- <allow interface="canonical.launchpad.interfaces.message.IMessage" />
+ class="lp.services.messages.model.message.Message">
+ <allow interface="lp.services.messages.interfaces.message.IMessage" />
<require
permission="launchpad.Admin"
set_attributes="visible"/>
</class>
- <class class="canonical.launchpad.interfaces.message.IndexedMessage">
- <allow interface="canonical.launchpad.interfaces.message.IMessage" />
- <allow interface="canonical.launchpad.interfaces.message.IIndexedMessage" />
+ <class class="lp.services.messages.interfaces.message.IndexedMessage">
+ <allow interface="lp.services.messages.interfaces.message.IMessage" />
+ <allow interface="lp.services.messages.interfaces.message.IIndexedMessage" />
</class>
<!-- MessageChunk -->
- <class class="canonical.launchpad.database.message.MessageChunk">
- <allow interface="canonical.launchpad.interfaces.message.IMessageChunk" />
+ <class class="lp.services.messages.model.message.MessageChunk">
+ <allow interface="lp.services.messages.interfaces.message.IMessageChunk" />
</class>
<!-- MessageSet -->
<securedutility
- class="canonical.launchpad.database.message.MessageSet"
- provides="canonical.launchpad.interfaces.message.IMessageSet">
- <allow interface="canonical.launchpad.interfaces.message.IMessageSet" />
+ class="lp.services.messages.model.message.MessageSet"
+ provides="lp.services.messages.interfaces.message.IMessageSet">
+ <allow interface="lp.services.messages.interfaces.message.IMessageSet" />
</securedutility>
<!-- Some message have a canonical_url -->
- <adapter for="canonical.launchpad.interfaces.message.IMessage"
+ <adapter for="lp.services.messages.interfaces.message.IMessage"
provides="canonical.launchpad.webapp.interfaces.ICanonicalUrlData"
factory="canonical.launchpad.browser.message.message_to_canonical_url_data"
/>
@@ -50,8 +50,8 @@
person-to-person emails. -->
<adapter
for="lp.registry.interfaces.person.IPerson"
- provides="canonical.launchpad.interfaces.message.IDirectEmailAuthorization"
- factory="canonical.launchpad.database.message.DirectEmailAuthorization"
+ provides="lp.services.messages.interfaces.message.IDirectEmailAuthorization"
+ factory="lp.services.messages.model.message.DirectEmailAuthorization"
/>
=== added directory 'lib/lp/services/messages/doc'
=== renamed file 'lib/canonical/launchpad/doc/message.txt' => 'lib/lp/services/messages/doc/message.txt'
--- lib/canonical/launchpad/doc/message.txt 2010-12-22 14:50:08 +0000
+++ lib/lp/services/messages/doc/message.txt 2011-05-13 17:24:28 +0000
@@ -58,7 +58,7 @@
You can build a Message from an email easily. This stuffs the original,
unadulterated, email into the Librarian and builds all the MessageChunks.
- >>> from canonical.launchpad.interfaces.message import IMessageSet
+ >>> from lp.services.messages.interfaces.message import IMessageSet
>>> msgset = getUtility(IMessageSet)
>>> raw_msg = u"""\
... Content-Type: multipart/mixed; charset="latin-1";
@@ -526,9 +526,9 @@
which often works.
>>> import os.path
- >>> msg_path = os.path.join(
- ... os.path.dirname(__file__),
- ... '../mail/ftests/emails/x-unknown-encoding.txt')
+ >>> mail_path = ('../../../../canonical/launchpad/mail/'
+ ... 'ftests/emails/x-unknown-encoding.txt')
+ >>> msg_path = os.path.join(os.path.dirname(__file__), mail_path)
>>> raw_msg = open(msg_path).read()
>>> print raw_msg
MIME-Version: 1.0
=== added directory 'lib/lp/services/messages/interfaces'
=== added file 'lib/lp/services/messages/interfaces/__init__.py'
=== renamed file 'lib/canonical/launchpad/interfaces/message.py' => 'lib/lp/services/messages/interfaces/message.py'
=== added directory 'lib/lp/services/messages/model'
=== added file 'lib/lp/services/messages/model/__init__.py'
=== renamed file 'lib/canonical/launchpad/database/message.py' => 'lib/lp/services/messages/model/message.py'
--- lib/canonical/launchpad/database/message.py 2011-03-10 19:53:03 +0000
+++ lib/lp/services/messages/model/message.py 2011-05-13 17:24:28 +0000
@@ -66,7 +66,7 @@
from canonical.launchpad.interfaces.librarian import (
ILibraryFileAliasSet,
)
-from canonical.launchpad.interfaces.message import (
+from lp.services.messages.interfaces.message import (
IDirectEmailAuthorization,
IMessage,
IMessageChunk,
=== added directory 'lib/lp/services/messages/tests'
=== added file 'lib/lp/services/messages/tests/__init__.py'
=== renamed file 'lib/canonical/launchpad/database/tests/test_message.py' => 'lib/lp/services/messages/tests/test_message.py'
--- lib/canonical/launchpad/database/tests/test_message.py 2011-03-08 21:47:16 +0000
+++ lib/lp/services/messages/tests/test_message.py 2011-05-13 17:24:28 +0000
@@ -18,16 +18,16 @@
import transaction
from zope.component import getUtility
-from canonical.launchpad.database.message import (
- MessageJob,
- MessageJobAction,
- MessageSet,
- )
from canonical.launchpad.ftests import login
from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
-from canonical.launchpad.interfaces.message import IMessageJob
from canonical.launchpad.webapp.testing import verifyObject
from canonical.testing.layers import LaunchpadFunctionalLayer
+from lp.services.messages.interfaces.message import IMessageJob
+from lp.services.messages.model.message import (
+ MessageJob,
+ MessageJobAction,
+ MessageSet,
+ )
from lp.services.job.model.job import Job
from lp.services.mail.sendmail import MailController
from lp.testing import TestCaseWithFactory
@@ -178,14 +178,3 @@
self.assertEqual('to@xxxxxxxxxxx', message['To'])
self.assertEqual('subject', message['Subject'])
self.assertEqual('body', message.get_payload())
-
-
-def test_suite():
- suite = unittest.TestSuite()
- suite.addTests(DocTestSuite('canonical.launchpad.database.message'))
- suite.addTests(unittest.TestLoader().loadTestsFromName(__name__))
- return suite
-
-if __name__ == '__main__':
- unittest.main(test_suite())
-
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2011-05-10 10:35:01 +0000
+++ lib/lp/testing/factory.py 2011-05-13 17:24:28 +0000
@@ -68,7 +68,7 @@
)
from canonical.database.sqlbase import flush_database_updates
from canonical.launchpad.database.account import Account
-from canonical.launchpad.database.message import (
+from lp.services.messages.model.message import (
Message,
MessageChunk,
)