# HG changeset patch # User Mads Kiilerich # Date 2015-07-20 13:11:41 # Node ID 87aebcc15dc2b84fa47907722ea5e230758c8147 # Parent 94e8d54252599c65f4827902dc52a15985c0b363 lib: cleanup around use of the random and hash libraries diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -33,7 +33,6 @@ import hashlib import itertools import collections -from tempfile import _RandomNameSequence from decorator import decorator from pylons import url, request diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -17,7 +17,6 @@ Helper functions 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.formatters.html import Htm 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 @@ def FID(raw_id, path): :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):