"Fossies" - the Fresh Open Source Software Archive

Member "mailman-3.3.7/src/mailman/handlers/after_delivery.py" (10 Nov 2022, 1334 Bytes) of package /linux/misc/mailman-3.3.7.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "after_delivery.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.3.5_vs_3.3.6.

    1 # Copyright (C) 1998-2022 by the Free Software Foundation, Inc.
    2 #
    3 # This file is part of GNU Mailman.
    4 #
    5 # GNU Mailman is free software: you can redistribute it and/or modify it under
    6 # the terms of the GNU General Public License as published by the Free
    7 # Software Foundation, either version 3 of the License, or (at your option)
    8 # any later version.
    9 #
   10 # GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
   11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   13 # more details.
   14 #
   15 # You should have received a copy of the GNU General Public License along with
   16 # GNU Mailman.  If not, see <https://www.gnu.org/licenses/>.
   17 
   18 """Perform some bookkeeping after a successful post."""
   19 
   20 from mailman.core.i18n import _
   21 from mailman.interfaces.handler import IHandler
   22 from mailman.utilities.datetime import now
   23 from public import public
   24 from zope.interface import implementer
   25 
   26 
   27 @public
   28 @implementer(IHandler)
   29 class AfterDelivery:
   30     """Perform some bookkeeping after a successful post."""
   31 
   32     name = 'after-delivery'
   33     description = _('Perform some bookkeeping after a successful post.')
   34 
   35     def process(self, mlist, msg, msgdata):
   36         """See `IHander`."""
   37         mlist.last_post_at = now()
   38         mlist.post_id += 1