Mercurial > kallithea
changeset 2966:566f0166f21e beta
yet another fix for commit linkifications
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 27 Oct 2012 00:51:08 +0200 |
parents | d0553004e73d |
children | e46d0a90556e |
files | rhodecode/lib/helpers.py |
diffstat | 1 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py Sat Oct 27 00:09:07 2012 +0200 +++ b/rhodecode/lib/helpers.py Sat Oct 27 00:51:08 2012 +0200 @@ -940,7 +940,6 @@ def urlify_text(text_): - import re url_pat = re.compile(r'''(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]''' '''|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)''') @@ -959,7 +958,7 @@ :param text_: :param repository: """ - import re + URL_PAT = re.compile(r'([0-9a-fA-F]{12,})') def url_func(match_obj): @@ -994,7 +993,6 @@ :param repository: :param link_: changeset link """ - import re import traceback def escaper(string): @@ -1071,13 +1069,11 @@ if link_: # wrap not links into final link => link_ newtext = linkify_others(newtext, link_) - - return literal(newtext) except: log.error(traceback.format_exc()) pass - return newtext + return literal(newtext) def rst(source):