comparison rhodecode/lib/utils2.py @ 2969:5085e51fba3a beta

Implemented #628: Pass server URL to rc-extensions hooks - updated rc-ext docs
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 27 Oct 2012 15:36:53 +0200
parents e2b2791d1e7c
children 6e76b4892d72
comparison
equal deleted inserted replaced
2968:4abfb1afd9f5 2969:5085e51fba3a
24 # along with this program. If not, see <http://www.gnu.org/licenses/>. 24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 25
26 import re 26 import re
27 import time 27 import time
28 import datetime 28 import datetime
29 import webob
30
29 from pylons.i18n.translation import _, ungettext 31 from pylons.i18n.translation import _, ungettext
30 from rhodecode.lib.vcs.utils.lazy import LazyProperty 32 from rhodecode.lib.vcs.utils.lazy import LazyProperty
31 33
32 34
33 def __get_lem(): 35 def __get_lem():
514 from sqlalchemy.engine import url 516 from sqlalchemy.engine import url
515 url = url.make_url(engine) 517 url = url.make_url(engine)
516 if url.password: 518 if url.password:
517 url.password = 'XXXXX' 519 url.password = 'XXXXX'
518 return str(url) 520 return str(url)
521
522
523 def get_server_url(environ):
524 req = webob.Request(environ)
525 return req.host_url + req.script_name