# HG changeset patch # User Mads Kiilerich # Date 1437397901 -7200 # Node ID 87aebcc15dc2b84fa47907722ea5e230758c8147 # Parent 94e8d54252599c65f4827902dc52a15985c0b363 lib: cleanup around use of the random and hash libraries diff -r 94e8d5425259 -r 87aebcc15dc2 kallithea/lib/auth.py --- a/kallithea/lib/auth.py Mon Jul 20 15:08:08 2015 +0200 +++ b/kallithea/lib/auth.py Mon Jul 20 15:11:41 2015 +0200 @@ -33,7 +33,6 @@ import itertools import collections -from tempfile import _RandomNameSequence from decorator import decorator from pylons import url, request diff -r 94e8d5425259 -r 87aebcc15dc2 kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py Mon Jul 20 15:08:08 2015 +0200 +++ b/kallithea/lib/helpers.py Mon Jul 20 15:11:41 2015 +0200 @@ -17,7 +17,6 @@ Consists of functions to typically be used within templates, but also available to Controllers. This module is available to both as 'h'. """ -import random import hashlib import StringIO import math @@ -30,7 +29,7 @@ from pygments import highlight as code_highlight from pylons import url from pylons.i18n.translation import _, ungettext -from hashlib import md5 +from hashlib import md5 # used as h.md5 from webhelpers.html import literal, HTML, escape from webhelpers.html.tools import * @@ -130,7 +129,7 @@ :param path: """ - return 'C-%s-%s' % (short_id(raw_id), md5(safe_str(path)).hexdigest()[:12]) + return 'C-%s-%s' % (short_id(raw_id), hashlib.md5(safe_str(path)).hexdigest()[:12]) class _GetError(object):