Changes between Version 59 and Version 60 of TracStandalone
- Timestamp:
- Sep 24, 2008, 7:50:42 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracStandalone
v59 v60 120 120 except ImportError: 121 121 from md5 import md5 122 realm = 'trac' 122 123 123 124 # build the options … … 128 129 parser.add_option("-p", "--password",action="store", dest="password", type = "string", 129 130 help="the password to use") 131 parser.add_option("-r", "--realm",action="store", dest="realm", type = "string", 132 help="the realm in which to create the digest") 130 133 (options, args) = parser.parse_args() 131 134 … … 133 136 if (options.username is None) or (options.password is None): 134 137 parser.error("You must supply both the username and password") 138 if (options.realm is not None): 139 realm = options.realm 135 140 136 141 # Generate the string to enter into the htdigest file 137 realm = 'trac'138 142 kd = lambda x: md5(':'.join(x)).hexdigest() 139 143 print ':'.join((options.username, realm, kd([options.username, realm, options.password])))