Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3753e48b1a
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (29 sloc) 0.917 kb
from datetime import datetime
from threading import RLock
import sys
import traceback
quiet = False
verbose = False
server = ''
lock = RLock()
TIME_FORMAT = '%d/%m/%Y %H:%M:%S'
def say(format, args=(), say_quiet=False):
if quiet and not say_quiet: return
with lock:
p = format % args
if verbose:
print '%s%s,' % (server, datetime.now().strftime(TIME_FORMAT)), p
else:
sys.stdout.write('\r%s\r%s%s' % (' '*80, server, p))
sys.stdout.flush()
def say_line(format, args=()):
if not verbose:
format = '%s, %s\n' % (datetime.now().strftime(TIME_FORMAT), format)
say(format, args)
def say_exception(message=''):
type, value, tb = sys.exc_info()
say_line(message + ' %s', str(value))
if verbose:
traceback.print_exception(type, value, tb)
def say_quiet(format, args=()):
say(format, args, True)
Jump to Line
Something went wrong with that request. Please try again.