diff options
| author | viega | 1998-05-30 06:06:53 +0000 |
|---|---|---|
| committer | viega | 1998-05-30 06:06:53 +0000 |
| commit | 4cf754ca57ef2e904082e105fcd4b78f97ed00a9 (patch) | |
| tree | a81db0267323e4200988d828cf3d83e206d06ce5 /modules | |
| parent | bc98003ed7879c4bf32735750c2a1adf88fbe3d3 (diff) | |
| download | mailman-4cf754ca57ef2e904082e105fcd4b78f97ed00a9.tar.gz mailman-4cf754ca57ef2e904082e105fcd4b78f97ed00a9.tar.zst mailman-4cf754ca57ef2e904082e105fcd4b78f97ed00a9.zip | |
Integrated Scott's cookie code into the distribution.
Note that it does have one problem... If you have cookies off, you
have to log in every time, plus your changes don't take effect!
That definitely needs to be fixed.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/htmlformat.py | 7 | ||||
| -rw-r--r-- | modules/maillist.py | 20 | ||||
| -rw-r--r-- | modules/mm_utils.py | 14 |
3 files changed, 31 insertions, 10 deletions
diff --git a/modules/htmlformat.py b/modules/htmlformat.py index 587bb1a0a..ddb6ac229 100644 --- a/modules/htmlformat.py +++ b/modules/htmlformat.py @@ -20,7 +20,7 @@ Encapsulate HTML formatting directives in classes that act as containers for python and, recursively, for nested HTML formatting objects.""" -__version__ = "$Revision: 547 $" +__version__ = "$Revision: 635 $" # Eventually could abstract down to HtmlItem, which outputs an arbitrary html # object given start / end tags, valid options, and a value. @@ -406,6 +406,11 @@ class RadioButton(InputObj): def __init__(self, name, value, checked=0, **kws): apply(InputObj.__init__, (self, name, 'RADIO', value, checked), kws) +class CheckBox(InputObj): + def __init__(self, name, value, checked=0, **kws): + apply(InputObj.__init__, (self, name, "CHECKBOX", value, checked), kws) + + class VerticalSpacer: def __init__(self, size=10): diff --git a/modules/maillist.py b/modules/maillist.py index 44339b4d9..406d1e599 100644 --- a/modules/maillist.py +++ b/modules/maillist.py @@ -75,8 +75,13 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, return '%s@%s' % (self._internal_name, self.host_name) def GetScriptURL(self, script_name): - return os.path.join(self.web_page_url, '%s/%s' % - (script_name, self._internal_name)) + if self.web_page_url: + prefix = self.web_page_url + else: + prefix = mm_cfg.DEFAULT_URL + return os.path.join(prefix, '%s/%s' % (script_name, + self._internal_name)) + def GetOptionsURL(self, addr, obscured=0): options = self.GetScriptURL('options') if obscured: @@ -85,9 +90,6 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, treated = addr return os.path.join(options, treated) - def GetOptionsURL(self, addr): - return os.path.join(self.GetScriptURL('options'), addr) - def GetUserOption(self, user, option): if option == mm_cfg.Digests: return user in self.digest_members @@ -212,10 +214,10 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, " what the list is."), ('info', mm_cfg.Text, (7, 50), 0, - 'An introductory description - a few paragraphs - about the' - 'list. It will be included, as html, at the top of the' - 'listinfo page. Carriage returns will end a paragraph - see' - 'the details for more info.', + ' An introductory description - a few paragraphs - about the' + ' list. It will be included, as html, at the top of the' + ' listinfo page. Carriage returns will end a paragraph - see' + ' the details for more info.', "The text will be treated as html <em>except</em> that newlines" " newlines will be translated to <br> - so you can use" diff --git a/modules/mm_utils.py b/modules/mm_utils.py index bc6b6a8da..419ae06a0 100644 --- a/modules/mm_utils.py +++ b/modules/mm_utils.py @@ -477,3 +477,17 @@ class StampedLogger(Logger): Logger.write(self, ' ' + l) else: Logger.write(self, l) + +def chunkify(members, chunksize=mm_cfg.ADMIN_MEMBER_CHUNKSIZE): + """ + return a list of lists of members + """ + members.sort() + res = [] + while 1: + if not members: + break + chunk = members[:chunksize] + res.append(chunk) + members = members[chunksize:] + return res |
