~msapiro/mailman/topics

« back to all changes in this revision

Viewing changes to Mailman/Pending.py

  • Committer: Mark Sapiro
  • Date: 2008-12-03 01:11:33 UTC
  • mfrom: (984.1.160 2.1)
  • mto: (1006.1.48 2.2)
  • mto: This revision was merged to the branch mainline in revision 1008.
  • Revision ID: mark@msapiro.net-20081203011133-4rrgvnkjtkv3qjlg
Merged Python 2.6 and other changes from the 2.1 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2004 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
2
2
#
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
17
17
"""Track pending actions which require confirmation."""
18
18
 
19
19
import os
20
 
import sha
21
20
import time
22
21
import errno
23
22
import random
24
23
import cPickle
25
24
 
26
25
from Mailman import mm_cfg
 
26
from Mailman.Utils import sha_new
27
27
 
28
28
# Types of pending records
29
29
SUBSCRIPTION = 'S'
72
72
        while True:
73
73
            now = time.time()
74
74
            x = random.random() + now % 1.0 + time.clock() % 1.0
75
 
            cookie = sha.new(repr(x)).hexdigest()
 
75
            cookie = sha_new(repr(x)).hexdigest()
76
76
            # We'll never get a duplicate, but we'll be anal about checking
77
77
            # anyway.
78
78
            if not db.has_key(cookie):