1
# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
1
# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
5
5
# as published by the Free Software Foundation; either version 2
6
6
# of the License, or (at your option) any later version.
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
11
# GNU General Public License for more details.
13
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18
19
"""Mixin class with list-digest handling methods and settings."""
21
from stat import ST_SIZE
24
from Mailman import mm_cfg
24
from Mailman import Errors
25
25
from Mailman import Utils
26
from Mailman import Errors
27
26
from Mailman.Handlers import ToDigest
27
from Mailman.configuration import config
28
28
from Mailman.i18n import _
33
33
def InitVars(self):
35
self.digestable = mm_cfg.DEFAULT_DIGESTABLE
36
self.digest_is_default = mm_cfg.DEFAULT_DIGEST_IS_DEFAULT
37
self.mime_is_default_digest = mm_cfg.DEFAULT_MIME_IS_DEFAULT_DIGEST
38
self.digest_size_threshhold = mm_cfg.DEFAULT_DIGEST_SIZE_THRESHHOLD
39
self.digest_send_periodic = mm_cfg.DEFAULT_DIGEST_SEND_PERIODIC
40
self.next_post_number = 1
41
self.digest_header = mm_cfg.DEFAULT_DIGEST_HEADER
42
self.digest_footer = mm_cfg.DEFAULT_DIGEST_FOOTER
43
self.digest_volume_frequency = mm_cfg.DEFAULT_DIGEST_VOLUME_FREQUENCY
35
self.digestable = config.DEFAULT_DIGESTABLE
36
self.digest_is_default = config.DEFAULT_DIGEST_IS_DEFAULT
37
self.mime_is_default_digest = config.DEFAULT_MIME_IS_DEFAULT_DIGEST
38
self.digest_size_threshhold = config.DEFAULT_DIGEST_SIZE_THRESHHOLD
39
self.digest_send_periodic = config.DEFAULT_DIGEST_SEND_PERIODIC
40
self.next_post_number = 1
41
self.digest_header = config.DEFAULT_DIGEST_HEADER
42
self.digest_footer = config.DEFAULT_DIGEST_FOOTER
43
self.digest_volume_frequency = config.DEFAULT_DIGEST_VOLUME_FREQUENCY
45
45
self.one_last_digest = {}
46
self.digest_members = {}
47
self.next_digest_number = 1
46
self.digest_members = {}
47
self.next_digest_number = 1
48
48
self.digest_last_sent_at = 0
50
50
def send_digest_now(self):