diff options
| author | bwarsaw | 2002-02-27 00:04:51 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-02-27 00:04:51 +0000 |
| commit | 72eeee3484cd36112702d4a4ff360413bbb37799 (patch) | |
| tree | 9b17e0ac7344dde7aafc82d4dd9d43e28aa9e9ff | |
| parent | dd88a7b4c0d9b77027233ef9722d5c2c6cf2fece (diff) | |
| download | mailman-72eeee3484cd36112702d4a4ff360413bbb37799.tar.gz mailman-72eeee3484cd36112702d4a4ff360413bbb37799.tar.zst mailman-72eeee3484cd36112702d4a4ff360413bbb37799.zip | |
Use GUIBase as the base class.
HandleForm(): Remove, obsolete API.
_setValue(): New overridden method which handles the special "do
immediately" attributes.
| -rw-r--r-- | Mailman/Gui/Digest.py | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/Mailman/Gui/Digest.py b/Mailman/Gui/Digest.py index 7f2206a9a..7eb486c74 100644 --- a/Mailman/Gui/Digest.py +++ b/Mailman/Gui/Digest.py @@ -21,11 +21,17 @@ from Mailman import Utils from Mailman.i18n import _ # Intra-package import -from Mailman.Gui.NonDigest import handle_form +from Mailman.Gui.GUIBase import GUIBase + +# Common b/w nondigest and digest headers & footers. Personalizations may add +# to this. +ALLOWEDS = ('real_name', 'list_name', 'host_name', 'web_page_url', + 'description', 'info', 'cgiext', '_internal_name', + ) -class Digest: +class Digest(GUIBase): def GetConfigCategory(self): return 'digest', _('Digest options') @@ -130,6 +136,25 @@ class Digest: return info - def HandleForm(self, mlist, cgidata, doc): - for attr in ('digest_header', 'digest_footer'): - handle_form(mlist, attr, cgidata, doc, 0) + def _setValue(self, mlist, property, val, doc): + # Watch for the special, immediate action attributes + if property == '_new_volume' and val: + mlist.bump_digest_volume() + volume = mlist.volume + number = mlist.next_digest_number + doc.AddItem(_("""The next digest will be sent as volume + %(volume)s, number %(number)s""")) + elif property == '_send_digest_now' and val: + status = mlist.send_digest_now() + if status: + doc.AddItem(_("""A digest has been sent.""")) + else: + doc.AddItem(_("""There was no digest to send.""")) + else: + # Everything else... + if property in ('digest_header', 'digest_footer'): + val = self._convertString(mlist, property, ALLOWEDS, val, doc) + if val is None: + # There was a problem, so don't set it + return + GUIBase._setValue(self, mlist, property, val, doc) |
