Edgewall Software

Changes between Version 57 and Version 58 of TracStandalone


Ignore:
Timestamp:
Jul 23, 2008, 1:43:35 AM (16 years ago)
Author:
Remy Blank <remy.blank@…>
Comment:

Fixed digest generation program for deprecated md5 module

Legend:

Unmodified
Added
Removed
Modified
  • TracStandalone

    v57 v58  
    114114#!python
    115115from optparse import OptionParser
    116 import md5
     116# The md5 module is deprecated in Python 2.5
     117try:
     118    from hashlib import md5
     119except ImportError:
     120    from md5 import md5
    117121
    118122# build the options
     
    131135# Generate the string to enter into the htdigest file
    132136realm = 'trac'
    133 kd = lambda x: md5.md5(':'.join(x)).hexdigest()
     137kd = lambda x: md5(':'.join(x)).hexdigest()
    134138print ':'.join((options.username, realm, kd([options.username, realm, options.password])))
    135139}}}