56
56
template_path = None
58
def __init__(self, branch):
58
def __init__(self, branch, history):
59
59
self._branch = branch
60
self._history = history
60
61
self.log = branch.log
62
63
def __call__(self, environ, start_response):
64
h = self._branch.history
65
66
kw = dict(parse_querystring(environ))
66
67
util.set_context(kw)
72
arg = path_info_pop(environ)
78
'branch': self._branch,
81
'url': self._branch.context_url,
83
vals.update(templatefunctions)
85
vals.update(self.get_values(h, args, kw, headers))
87
self.log.info('Getting information for %s: %r secs' % (
88
self.__class__.__name__, time.time() - z,))
89
if 'Content-Type' not in headers:
90
headers['Content-Type'] = 'text/html'
91
writer = start_response("200 OK", headers.items())
92
template = load_template(self.template_path)
94
w = BufferingWriter(writer, 8192)
95
template.expand_into(w, **vals)
97
self.log.info('Rendering %s: %r secs, %s bytes, %s (%2.1f%%) bytes saved' % (
98
self.__class__.__name__, time.time() - z, w.bytes, w.bytes_saved, 100.0*w.bytes_saved/w.bytes))
70
arg = path_info_pop(environ)
76
'branch': self._branch,
79
'url': self._branch.context_url,
81
vals.update(templatefunctions)
83
vals.update(self.get_values(h, args, kw, headers))
85
self.log.info('Getting information for %s: %r secs' % (
86
self.__class__.__name__, time.time() - z,))
87
if 'Content-Type' not in headers:
88
headers['Content-Type'] = 'text/html'
89
writer = start_response("200 OK", headers.items())
90
template = load_template(self.template_path)
92
w = BufferingWriter(writer, 8192)
93
template.expand_into(w, **vals)
95
self.log.info('Rendering %s: %r secs, %s bytes, %s (%2.1f%%) bytes saved' % (
96
self.__class__.__name__, time.time() - z, w.bytes, w.bytes_saved, 100.0*w.bytes_saved/w.bytes))