Show More
@@ -26,7 +26,7 b' import threading' | |||||
26 | from beaker.cache import _cache_decorate, cache_regions, region_invalidate |
|
26 | from beaker.cache import _cache_decorate, cache_regions, region_invalidate | |
27 | from sqlalchemy.exc import IntegrityError |
|
27 | from sqlalchemy.exc import IntegrityError | |
28 |
|
28 | |||
29 |
from rhodecode.lib.utils import safe_str, |
|
29 | from rhodecode.lib.utils import safe_str, sha1 | |
30 | from rhodecode.model.db import Session, CacheKey |
|
30 | from rhodecode.model.db import Session, CacheKey | |
31 |
|
31 | |||
32 | log = logging.getLogger(__name__) |
|
32 | log = logging.getLogger(__name__) | |
@@ -141,7 +141,7 b' def compute_key_from_params(*args):' | |||||
141 | """ |
|
141 | """ | |
142 | Helper to compute key from given params to be used in cache manager |
|
142 | Helper to compute key from given params to be used in cache manager | |
143 | """ |
|
143 | """ | |
144 |
return |
|
144 | return sha1("_".join(map(safe_str, args))) | |
145 |
|
145 | |||
146 |
|
146 | |||
147 | def get_repo_namespace_key(prefix, repo_name): |
|
147 | def get_repo_namespace_key(prefix, repo_name): |
@@ -48,7 +48,7 b' from rhodecode.lib.vcs.backends.base imp' | |||||
48 | from rhodecode.lib.vcs.exceptions import VCSError |
|
48 | from rhodecode.lib.vcs.exceptions import VCSError | |
49 | from rhodecode.lib.vcs.utils.helpers import get_scm, get_scm_backend |
|
49 | from rhodecode.lib.vcs.utils.helpers import get_scm, get_scm_backend | |
50 | from rhodecode.lib.utils2 import ( |
|
50 | from rhodecode.lib.utils2 import ( | |
51 | safe_str, safe_unicode, get_current_rhodecode_user, md5) |
|
51 | safe_str, safe_unicode, get_current_rhodecode_user, md5, sha1) | |
52 | from rhodecode.model import meta |
|
52 | from rhodecode.model import meta | |
53 | from rhodecode.model.db import ( |
|
53 | from rhodecode.model.db import ( | |
54 | Repository, User, RhodeCodeUi, UserLog, RepoGroup, UserGroup) |
|
54 | Repository, User, RhodeCodeUi, UserLog, RepoGroup, UserGroup) |
@@ -56,6 +56,14 b' def md5_safe(s):' | |||||
56 | return md5(safe_str(s)) |
|
56 | return md5(safe_str(s)) | |
57 |
|
57 | |||
58 |
|
58 | |||
|
59 | def sha1(s): | |||
|
60 | return hashlib.sha1(s).hexdigest() | |||
|
61 | ||||
|
62 | ||||
|
63 | def sha1_safe(s): | |||
|
64 | return sha1(safe_str(s)) | |||
|
65 | ||||
|
66 | ||||
59 | def __get_lem(extra_mapping=None): |
|
67 | def __get_lem(extra_mapping=None): | |
60 | """ |
|
68 | """ | |
61 | Get language extension map based on what's inside pygments lexers |
|
69 | Get language extension map based on what's inside pygments lexers |
General Comments 0
You need to be logged in to leave comments.
Login now