comparison rhodecode/lib/timerproxy.py @ 1512:bf263968da47

merge beta in stable branch
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 07 Oct 2011 01:08:50 +0200
parents 73434499fa72 1f47adeb67c2
children ffd45b185016
comparison
equal deleted inserted replaced
1329:e058df3ff2b4 1512:bf263968da47
3 import logging 3 import logging
4 log = logging.getLogger('timerproxy') 4 log = logging.getLogger('timerproxy')
5 5
6 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38) 6 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
7 7
8
8 def color_sql(sql): 9 def color_sql(sql):
9 COLOR_SEQ = "\033[1;%dm" 10 COLOR_SEQ = "\033[1;%dm"
10 COLOR_SQL = YELLOW 11 COLOR_SQL = YELLOW
11 normal = '\x1b[0m' 12 normal = '\x1b[0m'
12 return COLOR_SEQ % COLOR_SQL + sql + normal 13 return ''.join([COLOR_SEQ % COLOR_SQL, sql, normal])
14
13 15
14 class TimerProxy(ConnectionProxy): 16 class TimerProxy(ConnectionProxy):
15 17
16 def __init__(self): 18 def __init__(self):
17 super(TimerProxy, self).__init__() 19 super(TimerProxy, self).__init__()