From 4cf754ca57ef2e904082e105fcd4b78f97ed00a9 Mon Sep 17 00:00:00 2001 From: viega Date: Sat, 30 May 1998 06:06:53 +0000 Subject: 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. --- modules/mm_utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/mm_utils.py') 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 -- cgit v1.2.3-70-g09d2