##// END OF EJS Templates
utils: updated request generation so ishell can run some automation scripts.
marcink -
r3224:ea959a16 default
parent child
Show More
@@ -37,6 +37,23 def get_app_config(ini_path):
37 return appconfig('config:{}'.format(ini_path), relative_to=os.getcwd())
37 return appconfig('config:{}'.format(ini_path), relative_to=os.getcwd())
38
38
39
39
40 class BootstrappedRequest(Request):
41 """
42 Special version of Request Which has some available methods like in pyramid.
43 Some code (used for template rendering) requires this, and we unsure it's present.
44 """
45
46 def translate(self, msg):
47 return msg
48
49 def plularize(self, singular, plural, n):
50 return singular
51
52 def get_partial_renderer(self, tmpl_name):
53 from rhodecode.lib.partial_renderer import get_partial_renderer
54 return get_partial_renderer(request=self, tmpl_name=tmpl_name)
55
56
40 def bootstrap(config_uri, request=None, options=None, env=None):
57 def bootstrap(config_uri, request=None, options=None, env=None):
41 if env:
58 if env:
42 os.environ.update(env)
59 os.environ.update(env)
@@ -48,7 +65,7 def bootstrap(config_uri, request=None,
48 except (configparser.NoSectionError, configparser.NoOptionError):
65 except (configparser.NoSectionError, configparser.NoOptionError):
49 pass
66 pass
50
67
51 request = request or Request.blank('/', base_url=base_url)
68 request = request or BootstrappedRequest.blank('/', base_url=base_url)
52
69
53 return pyramid_bootstrap(config_uri, request=request, options=options)
70 return pyramid_bootstrap(config_uri, request=request, options=options)
54
71
General Comments 0
You need to be logged in to leave comments. Login now