Пример #1
0
 def _wdb_execute(self, transforms):
     from wdb import trace, Wdb
     if Wdb.enabled:
         with trace(close_on_exit=True, below=True):
             old_execute(self, transforms)
     else:
         old_execute(self, transforms)
         # Close set_trace debuggers
         stop_trace(close_on_exit=True)
Пример #2
0
 def _wdb_execute(self, transforms):
     from wdb import trace, Wdb
     if Wdb.enabled:
         with trace(close_on_exit=True, below=True):
             old_execute(self, transforms)
     else:
         old_execute(self, transforms)
         # Close set_trace debuggers
         stop_trace(close_on_exit=True)
Пример #3
0
 def _wdb_execute(*args, **kwargs):
     from wdb import trace, Wdb
     if Wdb.enabled:
         with trace(close_on_exit=True, below=below, under=under):
             old_execute(*args, **kwargs)
     else:
         old_execute(*args, **kwargs)
         # Close set_trace debuggers
         stop_trace(close_on_exit=True)
Пример #4
0
 def _wdb_execute(*args, **kwargs):
     from wdb import trace, Wdb
     if Wdb.enabled:
         with trace(close_on_exit=True, below=below, under=under):
             old_execute(*args, **kwargs)
     else:
         old_execute(*args, **kwargs)
         # Close set_trace debuggers
         stop_trace(close_on_exit=True)
Пример #5
0
 def catch(environ, start_response):
     appiter = None
     try:
         appiter = self.app(environ, start_response)
         for item in appiter:
             yield item
     except Exception:
         start_response('500 INTERNAL SERVER ERROR', [
             ('Content-Type', 'text/html')])
         yield _handle_off(self.theme)
     finally:
         # Close set_trace debuggers
         stop_trace(close_on_exit=True)
         hasattr(appiter, 'close') and appiter.close()
Пример #6
0
 def catch(environ, start_response):
     appiter = None
     try:
         appiter = self.app(environ, start_response)
         for item in appiter:
             yield item
     except Exception:
         start_response('500 INTERNAL SERVER ERROR',
                        [('Content-Type', 'text/html')])
         yield _handle_off()
     finally:
         # Close set_trace debuggers
         stop_trace(close_on_exit=True)
         hasattr(appiter, 'close') and appiter.close()
Пример #7
0
    def _wdb_execute(*args, **kwargs):
        from wdb import trace, Wdb
        interesting = True
        if len(args) > 0 and isinstance(args[0], ErrorHandler):
            interesting = False
        elif len(args) > 2 and isinstance(
                args[0], StaticFileHandler) and args[2] == 'favicon.ico':
            interesting = False

        if Wdb.enabled and interesting:
            with trace(close_on_exit=True, under=under):
                old_execute(*args, **kwargs)
        else:
            old_execute(*args, **kwargs)
            # Close set_trace debuggers
            stop_trace(close_on_exit=True)
Пример #8
0
Файл: ext.py Проект: minisin/wdb
    def _wdb_execute(*args, **kwargs):
        from wdb import trace, Wdb
        wdb = Wdb.get()
        wdb.closed = False  # Activate request ignores

        interesting = True
        if len(args) > 0 and isinstance(args[0], ErrorHandler):
            interesting = False
        elif len(args) > 2 and isinstance(
                args[0], StaticFileHandler) and args[2] == 'favicon.ico':
            interesting = False

        if Wdb.enabled and interesting:
            with trace(close_on_exit=True, under=under):
                old_execute(*args, **kwargs)
        else:
            old_execute(*args, **kwargs)
            # Close set_trace debuggers
            stop_trace(close_on_exit=True)

        # Reset closed state
        wdb.closed = False
Пример #9
0
import wdb


def divide_by_zero(z):
    return z / 0


def with_trace_fun():
    a = 2
    b = 4
    c = a + b
    print(c)
    d = divide_by_zero(c)
    print(d)
    print('The end')


wdb.start_trace()
try:
    with_trace_fun()
finally:
    wdb.stop_trace()
Пример #10
0
Файл: ext.py Проект: niziou/wdb
 def stop(self):
     stop_trace(sys._getframe().f_back)
Пример #11
0
import wdb


def divide_by_zero(z):
    return z / 0


def with_trace_fun():
    a = 2
    b = 4
    c = a + b
    print(c)
    try:
        d = divide_by_zero(c)
    except ZeroDivisionError:
        d = -1

    print(d)
    print('The end')

wdb.start_trace(full=True)
with_trace_fun()
wdb.stop_trace()
Пример #12
0
Файл: ext.py Проект: minisin/wdb
 def stop(self):
     stop_trace(sys._getframe().f_back)