web/views/massmailing.py
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 20 Jun 2013 16:19:27 +0200
changeset 9044 cfec5cc46008
parent 8849 7da8339cd768
permissions -rw-r--r--
[testlib] gather all repository access logic in one place Refactoring of the repository access API in test is imminent. We plan to move from the "old" dbapi to the new repoapi. Gathering all impacted method in one place help to understand how all those method interact and help readability for both patch and resulting code. No code change is done at all in this changeset. The refactoring will code later.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8849
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
     1
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     3
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     4
# This file is part of CubicWeb.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     5
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
     9
# any later version.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    10
#
5424
8ecbcbff9777 replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5421
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    14
# details.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    15
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5366
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
5556
9ab2b4c74baf [entity] introduce a new 'adapters' registry
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5424
diff changeset
    18
"""Mass mailing handling: send mail to entities adaptable to IEmailable"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    19
8849
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    20
try:
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    21
    from cubes.massmailing.views import (SendEmailAction,
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    22
                                         recipient_vocabulary,
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    23
                                         MassMailingForm,
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    24
                                         MassMailingFormRenderer,
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    25
                                         MassMailingFormView,
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    26
                                         SendMailController)
4161
4273f5094651 refactor vocabulary handling to avoid having to define methods
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4159
diff changeset
    27
5556
9ab2b4c74baf [entity] introduce a new 'adapters' registry
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5424
diff changeset
    28
8849
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    29
    from logilab.common.deprecation import class_moved, moved
1466
07a2d0c387ca [widgets] fix rendering of the sendmail widget, still to functional though
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1403
diff changeset
    30
8849
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    31
    msg = '[3.17] cubicweb.web.views.massmailing moved to cubes.massmailing.views'
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    32
    SendEmailAction = class_moved(SendEmailAction, message=msg)
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    33
    recipient_vocabulary = moved('cubes.massmailing.views', 'recipient_vocabulary')
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    34
    MassMailingForm = class_moved(MassMailingForm, message=msg)
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    35
    MassMailingFormRenderer = class_moved(MassMailingFormRenderer, message=msg)
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    36
    MassMailingFormView = class_moved(MassMailingFormView, message=msg)
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    37
    SendMailController = class_moved(SendMailController, message=msg)
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    38
except ImportError:
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    39
    from cubicweb.web import LOGGER
7da8339cd768 [web/views] Move massmailing to its own cube (closes #2788086)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 8719
diff changeset
    40
    LOGGER.warning('[3.17] massmailing extracted to cube massmailing that was not found. try installing it.')