Files
@ 158ef33603b8
Branch filter:
Location: kallithea/rhodecode/lib/timerproxy.py - annotation
158ef33603b8
1.5 KiB
text/x-python
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license.
The file was download and verified via these commands:
$ git clone https://github.com/ccampbell/mousetrap.git
$ cd mousetrap; git checkout 1.4.5
The file in that repository named mousetrap.js is exactly the same one that
appeared in RhodeCode 2.2.5 in changeset c8d3c0d61d95.
The mousetrap.js states clearly that it is licensed under Apache-2.0.
The file was download and verified via these commands:
$ git clone https://github.com/ccampbell/mousetrap.git
$ cd mousetrap; git checkout 1.4.5
The file in that repository named mousetrap.js is exactly the same one that
appeared in RhodeCode 2.2.5 in changeset c8d3c0d61d95.
The mousetrap.js states clearly that it is licensed under Apache-2.0.
ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 1fb97030b9b7 ffd45b185016 ffd45b185016 1fb97030b9b7 1fb97030b9b7 1e757ac98988 1e757ac98988 c1516b35f91d 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1f47adeb67c2 1e757ac98988 c1516b35f91d 1e757ac98988 b9ea10d3e419 1e757ac98988 1e757ac98988 b9ea10d3e419 b9ea10d3e419 b9ea10d3e419 b9ea10d3e419 1e757ac98988 1e757ac98988 1fb97030b9b7 1e757ac98988 1e757ac98988 1e757ac98988 1fb97030b9b7 | # -*- coding: utf-8 -*-
# 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 sqlalchemy.interfaces import ConnectionProxy
log = logging.getLogger('timerproxy')
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
def color_sql(sql):
COLOR_SEQ = "\033[1;%dm"
COLOR_SQL = YELLOW
normal = '\x1b[0m'
return ''.join([COLOR_SEQ % COLOR_SQL, sql, normal])
class TimerProxy(ConnectionProxy):
def __init__(self):
super(TimerProxy, self).__init__()
def cursor_execute(self, execute, cursor, statement, parameters,
context, executemany):
now = time.time()
try:
log.info(color_sql(">>>>> STARTING QUERY >>>>>"))
return execute(cursor, statement, parameters, context)
finally:
total = time.time() - now
log.info(color_sql("<<<<< TOTAL TIME: %f <<<<<" % total))
|