Show More
@@ -14,6 +14,7 b' from pygments.formatters.html import Htm' | |||||
14 | from pygments import highlight as code_highlight |
|
14 | from pygments import highlight as code_highlight | |
15 | from pylons import url, request, config |
|
15 | from pylons import url, request, config | |
16 | from pylons.i18n.translation import _, ungettext |
|
16 | from pylons.i18n.translation import _, ungettext | |
|
17 | from hashlib import md5 | |||
17 |
|
18 | |||
18 | from webhelpers.html import literal, HTML, escape |
|
19 | from webhelpers.html import literal, HTML, escape | |
19 | from webhelpers.html.tools import * |
|
20 | from webhelpers.html.tools import * | |
@@ -56,12 +57,14 b' safeid = _make_safe_id_component' | |||||
56 |
|
57 | |||
57 | def FID(raw_id, path): |
|
58 | def FID(raw_id, path): | |
58 | """ |
|
59 | """ | |
59 | Creates a uniqe ID for filenode based on it's path and revision |
|
60 | Creates a uniqe ID for filenode based on it's hash of path and revision | |
|
61 | it's safe to use in urls | |||
60 |
|
62 | |||
61 | :param raw_id: |
|
63 | :param raw_id: | |
62 | :param path: |
|
64 | :param path: | |
63 | """ |
|
65 | """ | |
64 | return 'C-%s-%s' % (short_id(raw_id), safeid(safe_unicode(path))) |
|
66 | ||
|
67 | return 'C-%s-%s' % (short_id(raw_id), md5(path).hexdigest()[:12]) | |||
65 |
|
68 | |||
66 |
|
69 | |||
67 | def get_token(): |
|
70 | def get_token(): |
General Comments 0
You need to be logged in to leave comments.
Login now