##// END OF EJS Templates
codecleaner
marcink -
r3500:a76ab013 beta
parent child Browse files
Show More
@@ -1,54 +1,54 b''
1 1 .c { color: #999988; font-style: italic } /* Comment */
2 2 .k { font-weight: bold } /* Keyword */
3 3 .o { font-weight: bold } /* Operator */
4 4 .cm { color: #999988; font-style: italic } /* Comment.Multiline */
5 5 .cp { color: #999999; font-weight: bold } /* Comment.preproc */
6 6 .c1 { color: #999988; font-style: italic } /* Comment.Single */
7 7 .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
8 8 .ge { font-style: italic } /* Generic.Emph */
9 9 .gr { color: #aa0000 } /* Generic.Error */
10 10 .gh { color: #999999 } /* Generic.Heading */
11 11 .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
12 12 .go { color: #111 } /* Generic.Output */
13 13 .gp { color: #555555 } /* Generic.Prompt */
14 14 .gs { font-weight: bold } /* Generic.Strong */
15 15 .gu { color: #aaaaaa } /* Generic.Subheading */
16 16 .gt { color: #aa0000 } /* Generic.Traceback */
17 17 .kc { font-weight: bold } /* Keyword.Constant */
18 18 .kd { font-weight: bold } /* Keyword.Declaration */
19 19 .kp { font-weight: bold } /* Keyword.Pseudo */
20 20 .kr { font-weight: bold } /* Keyword.Reserved */
21 21 .kt { color: #445588; font-weight: bold } /* Keyword.Type */
22 22 .m { color: #009999 } /* Literal.Number */
23 23 .s { color: #bb8844 } /* Literal.String */
24 24 .na { color: #008080 } /* Name.Attribute */
25 25 .nb { color: #999999 } /* Name.Builtin */
26 26 .nc { color: #445588; font-weight: bold } /* Name.Class */
27 27 .no { color: #ff99ff } /* Name.Constant */
28 28 .ni { color: #800080 } /* Name.Entity */
29 29 .ne { color: #990000; font-weight: bold } /* Name.Exception */
30 30 .nf { color: #990000; font-weight: bold } /* Name.Function */
31 31 .nn { color: #555555 } /* Name.Namespace */
32 32 .nt { color: #000080 } /* Name.Tag */
33 33 .nv { color: purple } /* Name.Variable */
34 34 .ow { font-weight: bold } /* Operator.Word */
35 35 .mf { color: #009999 } /* Literal.Number.Float */
36 36 .mh { color: #009999 } /* Literal.Number.Hex */
37 37 .mi { color: #009999 } /* Literal.Number.Integer */
38 38 .mo { color: #009999 } /* Literal.Number.Oct */
39 39 .sb { color: #bb8844 } /* Literal.String.Backtick */
40 40 .sc { color: #bb8844 } /* Literal.String.Char */
41 41 .sd { color: #bb8844 } /* Literal.String.Doc */
42 42 .s2 { color: #bb8844 } /* Literal.String.Double */
43 43 .se { color: #bb8844 } /* Literal.String.Escape */
44 44 .sh { color: #bb8844 } /* Literal.String.Heredoc */
45 45 .si { color: #bb8844 } /* Literal.String.Interpol */
46 46 .sx { color: #bb8844 } /* Literal.String.Other */
47 47 .sr { color: #808000 } /* Literal.String.Regex */
48 48 .s1 { color: #bb8844 } /* Literal.String.Single */
49 49 .ss { color: #bb8844 } /* Literal.String.Symbol */
50 50 .bp { color: #999999 } /* Name.Builtin.Pseudo */
51 51 .vc { color: #ff99ff } /* Name.Variable.Class */
52 52 .vg { color: #ff99ff } /* Name.Variable.Global */
53 53 .vi { color: #ff99ff } /* Name.Variable.Instance */
54 .il { color: #009999 } /* Literal.Number.Integer.Long */
54 .il { color: #009999 } /* Literal.Number.Integer.Long */ No newline at end of file
@@ -1,47 +1,46 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 rhodecode.lib.middleware.wrapper
4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 6 request time mesuring app
7 7
8 8 :created_on: May 23, 2013
9 9 :author: marcink
10 10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 11 :license: GPLv3, see COPYING for more details.
12 12 """
13 13 # This program is free software: you can redistribute it and/or modify
14 14 # it under the terms of the GNU General Public License as published by
15 15 # the Free Software Foundation, either version 3 of the License, or
16 16 # (at your option) any later version.
17 17 #
18 18 # This program is distributed in the hope that it will be useful,
19 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 21 # GNU General Public License for more details.
22 22 #
23 23 # You should have received a copy of the GNU General Public License
24 24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 25 import time
26 26 import logging
27 27 from rhodecode.lib.base import _get_ip_addr, _get_access_path
28 28 from rhodecode.lib.utils2 import safe_unicode
29 29
30 30
31 31 class RequestWrapper(object):
32 32
33 33 def __init__(self, app, config):
34 34 self.application = app
35 35 self.config = config
36 36
37 37 def __call__(self, environ, start_response):
38 38 start = time.time()
39 39 try:
40 40 return self.application(environ, start_response)
41 41 finally:
42 42 log = logging.getLogger('rhodecode.' + self.__class__.__name__)
43 43 log.info('IP: %s Request to %s time: %.3fs' % (
44 44 _get_ip_addr(environ),
45 45 safe_unicode(_get_access_path(environ)), time.time() - start)
46 46 )
47
General Comments 0
You need to be logged in to leave comments. Login now