viff

changeset 633:6581d7c7bc99

Deleted some old and unused debugging functions.
author Martin Geisler <mg@daimi.au.dk>
date Fri, 04 Apr 2008 10:37:46 +0200
parents c4f413f47784
children 9d4a0ade3918
files viff/util.py
diffstat 1 files changed, 0 insertions(+), 42 deletions(-) [+]
line diff
     1.1 --- a/viff/util.py	Fri Apr 04 10:34:07 2008 +0200
     1.2 +++ b/viff/util.py	Fri Apr 04 10:37:46 2008 +0200
     1.3 @@ -194,48 +194,6 @@
     1.4      original.addCallback(split_result)
     1.5      return clone
     1.6  
     1.7 -#: Indention level.
     1.8 -_indent = 0
     1.9 -#: Traced function call count.
    1.10 -_trace_counters = {}
    1.11 -
    1.12 -
    1.13 -def trace(func):
    1.14 -    """Trace function entry and exit.
    1.15 -
    1.16 -    Using this decorator on a function will make it print a line on
    1.17 -    entry and exit. The line is indented in nested calls, and contains
    1.18 -    the number of calls made to each function.
    1.19 -    """
    1.20 -    def wrapper(*args, **kwargs):
    1.21 -        """
    1.22 -        Wrapper with tracing output.
    1.23 -        """
    1.24 -        global _indent
    1.25 -        count = _trace_counters.setdefault(func.func_name, 1)
    1.26 -        try:
    1.27 -            print "%s-> Entering: %s (%d)" % ("  " * _indent,
    1.28 -                                              func.func_name, count)
    1.29 -            _indent += 1
    1.30 -            _trace_counters[func.func_name] += 1
    1.31 -            return func(*args, **kwargs)
    1.32 -        finally:
    1.33 -            _indent -= 1
    1.34 -            print "%s<- Exiting:  %s (%d)" % ("  " * _indent,
    1.35 -                                              func.func_name, count)
    1.36 -    return wrapper
    1.37 -
    1.38 -
    1.39 -def println(format="", *args):
    1.40 -    """Print a line indented according to the stack depth.
    1.41 -
    1.42 -    The L{_indent} variable holds the current stack depth.
    1.43 -    """
    1.44 -    if len(args) > 0:
    1.45 -        format = format % args
    1.46 -
    1.47 -    print "%s %s" % ("  " * _indent, format)
    1.48 -
    1.49  
    1.50  def find_prime(lower_bound, blum=False):
    1.51      """Find a prime above a lower bound.