diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-12-22 09:35:01 -0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-12-22 09:38:08 -0200 |
commit | 66839f191708a0725c8d9841d5266ad13af8ee81 (patch) | |
tree | 337fb19e99625cc3243f998a2351cea123c037a2 /service | |
parent | a0cbaf84fd86fc91cba892a7a19b0ade7c017a3c (diff) |
refactoring package structure
Diffstat (limited to 'service')
35 files changed, 234 insertions, 111 deletions
diff --git a/service/pixelated/adapter/__init__.py b/service/pixelated/adapter/__init__.py index e69de29b..2756a319 100644 --- a/service/pixelated/adapter/__init__.py +++ b/service/pixelated/adapter/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. diff --git a/service/pixelated/adapter/draft_service.py b/service/pixelated/adapter/draft_service.py deleted file mode 100644 index d9d6b12f..00000000 --- a/service/pixelated/adapter/draft_service.py +++ /dev/null @@ -1,19 +0,0 @@ - - -class DraftService(object): - __slots__ = '_mailboxes' - - def __init__(self, mailboxes): - self._mailboxes = mailboxes - - def create_draft(self, input_mail): - self._drafts().add(input_mail) - return input_mail - - def update_draft(self, ident, input_mail): - new_mail = self.create_draft(input_mail) - self._drafts().remove(ident) - return new_mail - - def _drafts(self): - return self._mailboxes.drafts() diff --git a/service/pixelated/adapter/listeners/__init__.py b/service/pixelated/adapter/listeners/__init__.py new file mode 100644 index 00000000..2756a319 --- /dev/null +++ b/service/pixelated/adapter/listeners/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. diff --git a/service/pixelated/adapter/mailbox_indexer_listener.py b/service/pixelated/adapter/listeners/mailbox_indexer_listener.py index d8e0f81e..d8e0f81e 100644 --- a/service/pixelated/adapter/mailbox_indexer_listener.py +++ b/service/pixelated/adapter/listeners/mailbox_indexer_listener.py diff --git a/service/pixelated/adapter/model/__init__.py b/service/pixelated/adapter/model/__init__.py new file mode 100644 index 00000000..2756a319 --- /dev/null +++ b/service/pixelated/adapter/model/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/model/mail.py index b6b566bb..0beb2111 100644 --- a/service/pixelated/adapter/mail.py +++ b/service/pixelated/adapter/model/mail.py @@ -20,7 +20,7 @@ from email.mime.text import MIMEText from leap.mail.imap.fields import fields import leap.mail.walk as walk import dateutil.parser as dateparser -from pixelated.adapter.status import Status +from pixelated.adapter.model.status import Status import pixelated.support.date from email.MIMEMultipart import MIMEMultipart from pycryptopp.hash import sha256 diff --git a/service/pixelated/adapter/status.py b/service/pixelated/adapter/model/status.py index 5a11ee7b..5a11ee7b 100644 --- a/service/pixelated/adapter/status.py +++ b/service/pixelated/adapter/model/status.py diff --git a/service/pixelated/adapter/tag.py b/service/pixelated/adapter/model/tag.py index d75022f9..d75022f9 100644 --- a/service/pixelated/adapter/tag.py +++ b/service/pixelated/adapter/model/tag.py diff --git a/service/pixelated/adapter/search.py b/service/pixelated/adapter/search/__init__.py index 3d71bab7..bbefc487 100644 --- a/service/pixelated/adapter/search.py +++ b/service/pixelated/adapter/search/__init__.py @@ -17,7 +17,7 @@ from pixelated.support.encrypted_file_storage import EncryptedFileStorage import os -from pixelated.adapter.status import Status +from pixelated.adapter.model.status import Status from pixelated.support.functional import flatten from whoosh.index import FileIndex from whoosh.fields import * diff --git a/service/pixelated/adapter/services/__init__.py b/service/pixelated/adapter/services/__init__.py new file mode 100644 index 00000000..2756a319 --- /dev/null +++ b/service/pixelated/adapter/services/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. diff --git a/service/pixelated/adapter/services/draft_service.py b/service/pixelated/adapter/services/draft_service.py new file mode 100644 index 00000000..ddb86c5c --- /dev/null +++ b/service/pixelated/adapter/services/draft_service.py @@ -0,0 +1,34 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. + + +class DraftService(object): + __slots__ = '_mailboxes' + + def __init__(self, mailboxes): + self._mailboxes = mailboxes + + def create_draft(self, input_mail): + self._drafts().add(input_mail) + return input_mail + + def update_draft(self, ident, input_mail): + new_mail = self.create_draft(input_mail) + self._drafts().remove(ident) + return new_mail + + def _drafts(self): + return self._mailboxes.drafts() diff --git a/service/pixelated/adapter/mail_sender.py b/service/pixelated/adapter/services/mail_sender.py index 50c17ba5..50c17ba5 100644 --- a/service/pixelated/adapter/mail_sender.py +++ b/service/pixelated/adapter/services/mail_sender.py diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/services/mail_service.py index 722b9a29..722b9a29 100644 --- a/service/pixelated/adapter/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py diff --git a/service/pixelated/adapter/mailbox.py b/service/pixelated/adapter/services/mailbox.py index fbdbfc30..fbdbfc30 100644 --- a/service/pixelated/adapter/mailbox.py +++ b/service/pixelated/adapter/services/mailbox.py diff --git a/service/pixelated/adapter/mailboxes.py b/service/pixelated/adapter/services/mailboxes.py index 241a8050..56304dd6 100644 --- a/service/pixelated/adapter/mailboxes.py +++ b/service/pixelated/adapter/services/mailboxes.py @@ -13,8 +13,8 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. -from pixelated.adapter.mailbox import Mailbox -from pixelated.adapter.mailbox_indexer_listener import MailboxIndexerListener +from pixelated.adapter.services.mailbox import Mailbox +from pixelated.adapter.listeners.mailbox_indexer_listener import MailboxIndexerListener class Mailboxes(): diff --git a/service/pixelated/adapter/tag_service.py b/service/pixelated/adapter/services/tag_service.py index 54b88622..c723b04c 100644 --- a/service/pixelated/adapter/tag_service.py +++ b/service/pixelated/adapter/services/tag_service.py @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. -from pixelated.adapter.tag import Tag +from pixelated.adapter.model.tag import Tag class TagService: diff --git a/service/pixelated/adapter/soledad/__init__.py b/service/pixelated/adapter/soledad/__init__.py new file mode 100644 index 00000000..2756a319 --- /dev/null +++ b/service/pixelated/adapter/soledad/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. diff --git a/service/pixelated/adapter/soledad_querier.py b/service/pixelated/adapter/soledad/soledad_querier.py index d76ac59f..b319eac0 100644 --- a/service/pixelated/adapter/soledad_querier.py +++ b/service/pixelated/adapter/soledad/soledad_querier.py @@ -17,7 +17,7 @@ import base64 import quopri from cryptography.fernet import Fernet -from pixelated.adapter.mail import PixelatedMail +from pixelated.adapter.model.mail import PixelatedMail import re @@ -26,36 +26,6 @@ class SoledadQuerier: def __init__(self, soledad): self.soledad = soledad - def get_index_masterkey(self): - index_key = self.soledad.get_from_index('by-type', 'index_key') - if len(index_key) == 0: - index_key = Fernet.generate_key() - self.soledad.create_doc(dict(type='index_key', value=index_key)) - return index_key - return str(index_key[0].content['value']) - - def _remove_many(self, docs): - [self.soledad.delete_doc(doc) for doc in docs] - - def _remove_dup_inboxes(self, mailbox_name): - mailboxes = self.soledad.get_from_index('by-type-and-mbox', 'mbox', mailbox_name) - if len(mailboxes) == 0: - return - mailboxes_to_remove = sorted(mailboxes, key=lambda x: x.content['created'])[1:len(mailboxes)] - self._remove_many(mailboxes_to_remove) - - def _remove_dup_recent(self, mailbox_name): - rct = self.soledad.get_from_index('by-type-and-mbox', 'rct', mailbox_name) - if len(rct) == 0: - return - rct_to_remove = sorted(rct, key=lambda x: len(x.content['rct']), reverse=True)[1:len(rct)] - self._remove_many(rct_to_remove) - - def remove_duplicates(self): - for mailbox in ['INBOX', 'DRAFTS', 'SENT', 'TRASH']: - self._remove_dup_inboxes(mailbox) - self._remove_dup_recent(mailbox) - def mark_all_as_not_recent(self): for mailbox in ['INBOX', 'DRAFTS', 'SENT', 'TRASH']: rct = self.soledad.get_from_index('by-type-and-mbox', 'rct', mailbox) @@ -121,6 +91,34 @@ class SoledadQuerier: return PixelatedMail.from_soledad(fdoc, hdoc, bdoc, parts=parts, soledad_querier=self) + def mails(self, idents): + fdocs_chash = [(self.soledad.get_from_index('by-type-and-contenthash', 'flags', ident), ident) for ident in idents] + fdocs_chash = [(result[0], ident) for result, ident in fdocs_chash if result] + return self._build_mails_from_fdocs(fdocs_chash) + + def remove_mail(self, mail): + _mail = self.mail(mail.ident) + # FIX-ME: Must go through all the part_map phash to delete all the cdocs + self.soledad.delete_doc(_mail.fdoc) + self.soledad.delete_doc(_mail.hdoc) + self.soledad.delete_doc(_mail.bdoc) + + def idents_by_mailbox(self, mailbox_name): + return set(doc.content['chash'] for doc in self.soledad.get_from_index('by-type-and-mbox-and-deleted', 'flags', mailbox_name, '0')) + + def _update_index(self, docs): + db = self.soledad._db + + indexed_fields = db._get_indexed_fields() + if indexed_fields: + # It is expected that len(indexed_fields) is shorter than + # len(raw_doc) + getters = [(field, db._parse_index_definition(field)) + for field in indexed_fields] + for doc in docs: + db._update_indexes(doc.doc_id, doc.content, getters, db._db_handle) + + # Attachments def attachment(self, ident, encoding): bdoc = self.soledad.get_from_index('by-type-and-payloadhash', 'cnt', ident)[0] return {'content': self._try_decode(bdoc.content['raw'], encoding), @@ -135,11 +133,6 @@ class SoledadQuerier: else: return str(raw) - def mails(self, idents): - fdocs_chash = [(self.soledad.get_from_index('by-type-and-contenthash', 'flags', ident), ident) for ident in idents] - fdocs_chash = [(result[0], ident) for result, ident in fdocs_chash if result] - return self._build_mails_from_fdocs(fdocs_chash) - def _extract_parts(self, hdoc, parts=None): if not parts: parts = {'alternatives': [], 'attachments': []} @@ -168,24 +161,34 @@ class SoledadQuerier: filename = match.group(1) return {'headers': headers_dict, 'ident': hdoc['phash'], 'name': filename} - def remove_mail(self, mail): - _mail = self.mail(mail.ident) - # FIX-ME: Must go through all the part_map phash to delete all the cdocs - self.soledad.delete_doc(_mail.fdoc) - self.soledad.delete_doc(_mail.hdoc) - self.soledad.delete_doc(_mail.bdoc) + # Removing duplicates + def remove_duplicates(self): + for mailbox in ['INBOX', 'DRAFTS', 'SENT', 'TRASH']: + self._remove_dup_inboxes(mailbox) + self._remove_dup_recent(mailbox) - def idents_by_mailbox(self, mailbox_name): - return set(doc.content['chash'] for doc in self.soledad.get_from_index('by-type-and-mbox-and-deleted', 'flags', mailbox_name, '0')) + def _remove_many(self, docs): + [self.soledad.delete_doc(doc) for doc in docs] - def _update_index(self, docs): - db = self.soledad._db + def _remove_dup_inboxes(self, mailbox_name): + mailboxes = self.soledad.get_from_index('by-type-and-mbox', 'mbox', mailbox_name) + if len(mailboxes) == 0: + return + mailboxes_to_remove = sorted(mailboxes, key=lambda x: x.content['created'])[1:len(mailboxes)] + self._remove_many(mailboxes_to_remove) - indexed_fields = db._get_indexed_fields() - if indexed_fields: - # It is expected that len(indexed_fields) is shorter than - # len(raw_doc) - getters = [(field, db._parse_index_definition(field)) - for field in indexed_fields] - for doc in docs: - db._update_indexes(doc.doc_id, doc.content, getters, db._db_handle) + def _remove_dup_recent(self, mailbox_name): + rct = self.soledad.get_from_index('by-type-and-mbox', 'rct', mailbox_name) + if len(rct) == 0: + return + rct_to_remove = sorted(rct, key=lambda x: len(x.content['rct']), reverse=True)[1:len(rct)] + self._remove_many(rct_to_remove) + + # Search Index encryption key get/create + def get_index_masterkey(self): + index_key = self.soledad.get_from_index('by-type', 'index_key') + if len(index_key) == 0: + index_key = Fernet.generate_key() + self.soledad.create_doc(dict(type='index_key', value=index_key)) + return index_key + return str(index_key[0].content['value']) diff --git a/service/pixelated/config/app_factory.py b/service/pixelated/config/app_factory.py index 45a0ea84..035a16b2 100644 --- a/service/pixelated/config/app_factory.py +++ b/service/pixelated/config/app_factory.py @@ -22,19 +22,19 @@ from twisted.internet import ssl from twisted.web import resource from twisted.web.util import redirectTo from pixelated.config.routes import setup_routes -from pixelated.adapter.mail_service import MailService -from pixelated.adapter.mail import InputMail -from pixelated.adapter.mail_sender import MailSender -from pixelated.adapter.mailboxes import Mailboxes -from pixelated.adapter.soledad_querier import SoledadQuerier +from pixelated.adapter.services.mail_service import MailService +from pixelated.adapter.model.mail import InputMail +from pixelated.adapter.services.mail_sender import MailSender +from pixelated.adapter.services.mailboxes import Mailboxes +from pixelated.adapter.soledad.soledad_querier import SoledadQuerier from pixelated.adapter.search import SearchEngine -from pixelated.adapter.draft_service import DraftService -from pixelated.adapter.mailbox_indexer_listener import MailboxIndexerListener +from pixelated.adapter.services.draft_service import DraftService +from pixelated.adapter.listeners.mailbox_indexer_listener import MailboxIndexerListener import pixelated.bitmask_libraries.session as LeapSession from pixelated.bitmask_libraries.leap_srp import LeapAuthException from requests.exceptions import ConnectionError from pixelated.controllers import * -from pixelated.adapter.tag_service import TagService +from pixelated.adapter.services.tag_service import TagService from leap.common.events import ( register, unregister, diff --git a/service/pixelated/controllers/mails_controller.py b/service/pixelated/controllers/mails_controller.py index eba97784..50256fa5 100644 --- a/service/pixelated/controllers/mails_controller.py +++ b/service/pixelated/controllers/mails_controller.py @@ -16,7 +16,7 @@ import json -from pixelated.adapter.mail import InputMail +from pixelated.adapter.model.mail import InputMail from pixelated.controllers import respond_json diff --git a/service/setup.py b/service/setup.py index 60625013..a68c0a62 100644 --- a/service/setup.py +++ b/service/setup.py @@ -16,6 +16,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import sys + if 'develop' in sys.argv: sys.argv.append('--always-unzip') @@ -64,6 +65,7 @@ def data_files(): def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() + setup(name='pixelated-user-agent', version='0.1', description='API to serve the pixelated front-end requests', @@ -71,7 +73,20 @@ setup(name='pixelated-user-agent', author='Thoughtworks', author_email='pixelated-team@thoughtworks.com', url='http://pixelated-project.github.io', - packages=['pixelated', 'pixelated.adapter', 'pixelated.bitmask_libraries', 'pixelated.config', 'pixelated.certificates', 'pixelated.support', 'pixelated.controllers'], + packages=[ + 'pixelated', + 'pixelated.adapter', + 'pixelated.adapter.listeners', + 'pixelated.adapter.model', + 'pixelated.adapter.search', + 'pixelated.adapter.services', + 'pixelated.adapter.soledad', + 'pixelated.bitmask_libraries', + 'pixelated.config', + 'pixelated.certificates', + 'pixelated.support', + 'pixelated.controllers' + ], test_suite='nose.collector', install_requires=[ 'pyasn1==0.1.7', @@ -96,4 +111,4 @@ setup(name='pixelated-user-agent', }, data_files=data_files(), include_package_data=True - ) +) diff --git a/service/test/integration/contacts_test.py b/service/test/integration/contacts_test.py index 85d6cd3d..925e5e02 100644 --- a/service/test/integration/contacts_test.py +++ b/service/test/integration/contacts_test.py @@ -1,3 +1,18 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. from nose.twistedtools import deferred from test.support.integration import SoledadTestBase, MailBuilder diff --git a/service/test/integration/mark_as_read_unread_test.py b/service/test/integration/mark_as_read_unread_test.py index 03da404f..86a48e62 100644 --- a/service/test/integration/mark_as_read_unread_test.py +++ b/service/test/integration/mark_as_read_unread_test.py @@ -15,7 +15,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. from test.support.integration import * -from pixelated.adapter.status import Status +from pixelated.adapter.model.status import Status class MarkAsReadUnreadTest(SoledadTestBase): diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py index 82b34d69..4d444f8d 100644 --- a/service/test/support/integration/app_test_client.py +++ b/service/test/support/integration/app_test_client.py @@ -24,15 +24,15 @@ from leap.mail.imap.account import SoledadBackedAccount from leap.soledad.client import Soledad from mock import MagicMock, Mock import os -from pixelated.adapter.draft_service import DraftService -from pixelated.adapter.mail_service import MailService -from pixelated.adapter.mailboxes import Mailboxes -from pixelated.adapter.soledad_querier import SoledadQuerier -from pixelated.adapter.tag_service import TagService +from pixelated.adapter.services.draft_service import DraftService +from pixelated.adapter.services.mail_service import MailService +from pixelated.adapter.services.mailboxes import Mailboxes +from pixelated.adapter.soledad.soledad_querier import SoledadQuerier +from pixelated.adapter.services.tag_service import TagService from pixelated.controllers import FeaturesController, HomeController, MailsController, TagsController, \ SyncInfoController, AttachmentsController, ContactsController import pixelated.runserver -from pixelated.adapter.mail import PixelatedMail +from pixelated.adapter.model.mail import PixelatedMail from pixelated.adapter.search import SearchEngine from test.support.integration.model import MailBuilder diff --git a/service/test/support/integration/model.py b/service/test/support/integration/model.py index e05d74bb..ea5dcad0 100644 --- a/service/test/support/integration/model.py +++ b/service/test/support/integration/model.py @@ -15,8 +15,8 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import json -from pixelated.adapter.mail import InputMail -from pixelated.adapter.status import Status +from pixelated.adapter.model.mail import InputMail +from pixelated.adapter.model.status import Status class MailBuilder: diff --git a/service/test/support/test_helper.py b/service/test/support/test_helper.py index 881e1e5c..b2d3cf43 100644 --- a/service/test/support/test_helper.py +++ b/service/test/support/test_helper.py @@ -15,7 +15,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. from datetime import datetime -from pixelated.adapter.mail import InputMail +from pixelated.adapter.model.mail import InputMail LEAP_FLAGS = ['\\Seen', diff --git a/service/test/unit/adapter/draft_service_test.py b/service/test/unit/adapter/draft_service_test.py index b9f1c267..baa07ce0 100644 --- a/service/test/unit/adapter/draft_service_test.py +++ b/service/test/unit/adapter/draft_service_test.py @@ -1,7 +1,7 @@ import unittest -from pixelated.adapter.mail import InputMail -from pixelated.adapter.draft_service import DraftService +from pixelated.adapter.model.mail import InputMail +from pixelated.adapter.services.draft_service import DraftService import test.support.test_helper as test_helper from mockito import * diff --git a/service/test/unit/adapter/mail_service_test.py b/service/test/unit/adapter/mail_service_test.py index e5085724..6f80c043 100644 --- a/service/test/unit/adapter/mail_service_test.py +++ b/service/test/unit/adapter/mail_service_test.py @@ -15,7 +15,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import unittest -from pixelated.adapter.mail_service import MailService +from pixelated.adapter.services.mail_service import MailService from mockito import * diff --git a/service/test/unit/adapter/mail_test.py b/service/test/unit/adapter/mail_test.py index 13eef91e..e8fd8755 100644 --- a/service/test/unit/adapter/mail_test.py +++ b/service/test/unit/adapter/mail_test.py @@ -16,7 +16,7 @@ import unittest import pixelated.support.date -from pixelated.adapter.mail import PixelatedMail, InputMail +from pixelated.adapter.model.mail import PixelatedMail, InputMail from mockito import * from test.support import test_helper import dateutil.parser as dateparser diff --git a/service/test/unit/adapter/mailbox_indexer_listener_test.py b/service/test/unit/adapter/mailbox_indexer_listener_test.py index 291739e0..65ba8966 100644 --- a/service/test/unit/adapter/mailbox_indexer_listener_test.py +++ b/service/test/unit/adapter/mailbox_indexer_listener_test.py @@ -16,7 +16,7 @@ import unittest from mockito import * -from pixelated.adapter.mailbox_indexer_listener import MailboxIndexerListener +from pixelated.adapter.listeners.mailbox_indexer_listener import MailboxIndexerListener class MailboxListenerTest(unittest.TestCase): diff --git a/service/test/unit/adapter/mailbox_test.py b/service/test/unit/adapter/mailbox_test.py index df46d02d..9725f418 100644 --- a/service/test/unit/adapter/mailbox_test.py +++ b/service/test/unit/adapter/mailbox_test.py @@ -15,8 +15,8 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import unittest -from pixelated.adapter.mail import PixelatedMail -from pixelated.adapter.mailbox import Mailbox +from pixelated.adapter.model.mail import PixelatedMail +from pixelated.adapter.services.mailbox import Mailbox from mockito import * from test.support import test_helper diff --git a/service/test/unit/adapter/mailboxes_test.py b/service/test/unit/adapter/mailboxes_test.py index cbed4577..542877d1 100644 --- a/service/test/unit/adapter/mailboxes_test.py +++ b/service/test/unit/adapter/mailboxes_test.py @@ -16,8 +16,8 @@ import unittest from mockito import * -from pixelated.adapter.mailbox import Mailbox -from pixelated.adapter.mailboxes import Mailboxes +from pixelated.adapter.services.mailbox import Mailbox +from pixelated.adapter.services.mailboxes import Mailboxes class PixelatedMailboxesTest(unittest.TestCase): diff --git a/service/test/unit/adapter/soledad_querier_test.py b/service/test/unit/adapter/soledad_querier_test.py index 561c4cb8..2cc23750 100644 --- a/service/test/unit/adapter/soledad_querier_test.py +++ b/service/test/unit/adapter/soledad_querier_test.py @@ -18,7 +18,7 @@ import json import base64 import quopri -from pixelated.adapter.soledad_querier import SoledadQuerier +from pixelated.adapter.soledad.soledad_querier import SoledadQuerier from mockito import mock, when, any import os diff --git a/service/test/unit/adapter/test_status.py b/service/test/unit/adapter/test_status.py index e9ead384..5cd0fa1e 100644 --- a/service/test/unit/adapter/test_status.py +++ b/service/test/unit/adapter/test_status.py @@ -15,7 +15,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import unittest -from pixelated.adapter.status import Status +from pixelated.adapter.model.status import Status class TestStatus(unittest.TestCase): diff --git a/service/test/unit/adapter/test_tag.py b/service/test/unit/adapter/test_tag.py index fc14ff49..a4fa819e 100644 --- a/service/test/unit/adapter/test_tag.py +++ b/service/test/unit/adapter/test_tag.py @@ -15,7 +15,7 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import unittest -from pixelated.adapter.tag import Tag +from pixelated.adapter.model.tag import Tag class TestTag(unittest.TestCase): |