~divmod-dev/divmod.org/athena-events-806545

« back to all changes in this revision

Viewing changes to Nevow/nevow/guard.py

  • Committer: exarkun
  • Date: 2010-02-06 04:33:05 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:17903
Merge nevow-deprecations-2994

Author: exarkun, zooko
Reviewer: zooko, exarkun
Fixes: #2994

Change several uses of deprecated APIs in Nevow to more modern equivalents,
eliminating the annoying deprecation warnings when loading nevow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
import random
14
14
import time
15
 
import md5
 
15
try:
 
16
    from hashlib import md5
 
17
except ImportError:
 
18
    from md5 import md5
16
19
import StringIO
17
20
 
18
21
from zope.interface import implements
34
37
 
35
38
 
36
39
def _sessionCookie():
37
 
    return md5.new("%s_%s" % (str(random.random()) , str(time.time()))).hexdigest()
 
40
    return md5("%s_%s" % (str(random.random()) , str(time.time()))).hexdigest()
38
41
 
39
42
 
40
43
class GuardSession(components.Componentized):