Changeset - a76ab0130dbe
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-03-07 15:06:40
marcin@python-works.com
codecleaner
2 files changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
docs/theme/nature/static/pygments.css
Show inline comments
 
.c { color: #999988; font-style: italic } /* Comment */
 
.k { font-weight: bold } /* Keyword */
 
.o { font-weight: bold } /* Operator */
 
.cm { color: #999988; font-style: italic } /* Comment.Multiline */
 
.cp { color: #999999; font-weight: bold } /* Comment.preproc */
 
.c1 { color: #999988; font-style: italic } /* Comment.Single */
 
.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
 
.ge { font-style: italic } /* Generic.Emph */
 
.gr { color: #aa0000 } /* Generic.Error */
 
.gh { color: #999999 } /* Generic.Heading */
 
.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
 
.go { color: #111 } /* Generic.Output */
 
.gp { color: #555555 } /* Generic.Prompt */
 
.gs { font-weight: bold } /* Generic.Strong */
 
.gu { color: #aaaaaa } /* Generic.Subheading */
 
.gt { color: #aa0000 } /* Generic.Traceback */
 
.kc { font-weight: bold } /* Keyword.Constant */
 
.kd { font-weight: bold } /* Keyword.Declaration */
 
.kp { font-weight: bold } /* Keyword.Pseudo */
 
.kr { font-weight: bold } /* Keyword.Reserved */
 
.kt { color: #445588; font-weight: bold } /* Keyword.Type */
 
.m { color: #009999 } /* Literal.Number */
 
.s { color: #bb8844 } /* Literal.String */
 
.na { color: #008080 } /* Name.Attribute */
 
.nb { color: #999999 } /* Name.Builtin */
 
.nc { color: #445588; font-weight: bold } /* Name.Class */
 
.no { color: #ff99ff } /* Name.Constant */
 
.ni { color: #800080 } /* Name.Entity */
 
.ne { color: #990000; font-weight: bold } /* Name.Exception */
 
.nf { color: #990000; font-weight: bold } /* Name.Function */
 
.nn { color: #555555 } /* Name.Namespace */
 
.nt { color: #000080 } /* Name.Tag */
 
.nv { color: purple } /* Name.Variable */
 
.ow { font-weight: bold } /* Operator.Word */
 
.mf { color: #009999 } /* Literal.Number.Float */
 
.mh { color: #009999 } /* Literal.Number.Hex */
 
.mi { color: #009999 } /* Literal.Number.Integer */
 
.mo { color: #009999 } /* Literal.Number.Oct */
 
.sb { color: #bb8844 } /* Literal.String.Backtick */
 
.sc { color: #bb8844 } /* Literal.String.Char */
 
.sd { color: #bb8844 } /* Literal.String.Doc */
 
.s2 { color: #bb8844 } /* Literal.String.Double */
 
.se { color: #bb8844 } /* Literal.String.Escape */
 
.sh { color: #bb8844 } /* Literal.String.Heredoc */
 
.si { color: #bb8844 } /* Literal.String.Interpol */
 
.sx { color: #bb8844 } /* Literal.String.Other */
 
.sr { color: #808000 } /* Literal.String.Regex */
 
.s1 { color: #bb8844 } /* Literal.String.Single */
 
.ss { color: #bb8844 } /* Literal.String.Symbol */
 
.bp { color: #999999 } /* Name.Builtin.Pseudo */
 
.vc { color: #ff99ff } /* Name.Variable.Class */
 
.vg { color: #ff99ff } /* Name.Variable.Global */
 
.vi { color: #ff99ff } /* Name.Variable.Instance */
 
.il { color: #009999 } /* Literal.Number.Integer.Long */
 
.il { color: #009999 } /* Literal.Number.Integer.Long */
 
\ No newline at end of file
rhodecode/lib/middleware/wrapper.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.lib.middleware.wrapper
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    request time mesuring app
 

	
 
    :created_on: May 23, 2013
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
import time
 
import logging
 
from rhodecode.lib.base import _get_ip_addr, _get_access_path
 
from rhodecode.lib.utils2 import safe_unicode
 

	
 

	
 
class RequestWrapper(object):
 

	
 
    def __init__(self, app, config):
 
        self.application = app
 
        self.config = config
 

	
 
    def __call__(self, environ, start_response):
 
        start = time.time()
 
        try:
 
            return self.application(environ, start_response)
 
        finally:
 
            log = logging.getLogger('rhodecode.' + self.__class__.__name__)
 
            log.info('IP: %s Request to %s time: %.3fs' % (
 
                _get_ip_addr(environ),
 
                safe_unicode(_get_access_path(environ)), time.time() - start)
 
            )
 

	
0 comments (0 inline, 0 general)