##// END OF EJS Templates
lib: cleanup around use of the random and hash libraries
Mads Kiilerich -
r5273:87aebcc1 default
parent child Browse files
Show More
@@ -33,7 +33,6 b' import hashlib'
33 import itertools
33 import itertools
34 import collections
34 import collections
35
35
36 from tempfile import _RandomNameSequence
37 from decorator import decorator
36 from decorator import decorator
38
37
39 from pylons import url, request
38 from pylons import url, request
@@ -17,7 +17,6 b' Helper functions'
17 Consists of functions to typically be used within templates, but also
17 Consists of functions to typically be used within templates, but also
18 available to Controllers. This module is available to both as 'h'.
18 available to Controllers. This module is available to both as 'h'.
19 """
19 """
20 import random
21 import hashlib
20 import hashlib
22 import StringIO
21 import StringIO
23 import math
22 import math
@@ -30,7 +29,7 b' from pygments.formatters.html import Htm'
30 from pygments import highlight as code_highlight
29 from pygments import highlight as code_highlight
31 from pylons import url
30 from pylons import url
32 from pylons.i18n.translation import _, ungettext
31 from pylons.i18n.translation import _, ungettext
33 from hashlib import md5
32 from hashlib import md5 # used as h.md5
34
33
35 from webhelpers.html import literal, HTML, escape
34 from webhelpers.html import literal, HTML, escape
36 from webhelpers.html.tools import *
35 from webhelpers.html.tools import *
@@ -130,7 +129,7 b' def FID(raw_id, path):'
130 :param path:
129 :param path:
131 """
130 """
132
131
133 return 'C-%s-%s' % (short_id(raw_id), md5(safe_str(path)).hexdigest()[:12])
132 return 'C-%s-%s' % (short_id(raw_id), hashlib.md5(safe_str(path)).hexdigest()[:12])
134
133
135
134
136 class _GetError(object):
135 class _GetError(object):
General Comments 0
You need to be logged in to leave comments. Login now