comparison rhodecode/lib/helpers.py @ 3179:cd50d1b5f35b

merged with beta
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 21 Jan 2013 00:03:44 +0100
parents 3259dc7caea4 1ab01549f1f8
children 2cd0c8251aa2
comparison
equal deleted inserted replaced
3113:a0737406ce26 3179:cd50d1b5f35b
462 """ 462 """
463 value = re.sub(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]', 463 value = re.sub(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]',
464 '<div class="metatag" tag="see">see =&gt; \\1 </div>', value) 464 '<div class="metatag" tag="see">see =&gt; \\1 </div>', value)
465 value = re.sub(r'\[license\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]', 465 value = re.sub(r'\[license\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]',
466 '<div class="metatag" tag="license"><a href="http:\/\/www.opensource.org/licenses/\\1">\\1</a></div>', value) 466 '<div class="metatag" tag="license"><a href="http:\/\/www.opensource.org/licenses/\\1">\\1</a></div>', value)
467 value = re.sub(r'\[(requires|recommends|conflicts|base)\ \=\>\ *([a-zA-Z\-\/]*)\]', 467 value = re.sub(r'\[(requires|recommends|conflicts|base)\ \=\>\ *([a-zA-Z0-9\-\/]*)\]',
468 '<div class="metatag" tag="\\1">\\1 =&gt; <a href="/\\2">\\2</a></div>', value) 468 '<div class="metatag" tag="\\1">\\1 =&gt; <a href="/\\2">\\2</a></div>', value)
469 value = re.sub(r'\[(lang|language)\ \=\>\ *([a-zA-Z\-\/\#\+]*)\]', 469 value = re.sub(r'\[(lang|language)\ \=\>\ *([a-zA-Z\-\/\#\+]*)\]',
470 '<div class="metatag" tag="lang">\\2</div>', value) 470 '<div class="metatag" tag="lang">\\2</div>', value)
471 value = re.sub(r'\[([a-z]+)\]', 471 value = re.sub(r'\[([a-z]+)\]',
472 '<div class="metatag" tag="\\1">\\1</div>', value) 472 '<div class="metatag" tag="\\1">\\1</div>', value)
1162 def not_mapped_error(repo_name): 1162 def not_mapped_error(repo_name):
1163 flash(_('%s repository is not mapped to db perhaps' 1163 flash(_('%s repository is not mapped to db perhaps'
1164 ' it was created or renamed from the filesystem' 1164 ' it was created or renamed from the filesystem'
1165 ' please run the application again' 1165 ' please run the application again'
1166 ' in order to rescan repositories') % repo_name, category='error') 1166 ' in order to rescan repositories') % repo_name, category='error')
1167
1168
1169 def ip_range(ip_addr):
1170 from rhodecode.model.db import UserIpMap
1171 s, e = UserIpMap._get_ip_range(ip_addr)
1172 return '%s - %s' % (s, e)