Example #1
0
File: ext.py Project: rayleyva/wdb
 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)
Example #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)
Example #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)
Example #4
0
File: ext.py Project: kaka19ace/wdb
 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)
Example #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()
Example #6
0
File: ext.py Project: rayleyva/wdb
 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()
Example #7
0
File: ext.py Project: s0undt3ch/wdb
    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)
Example #8
0
File: ext.py Project: 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
Example #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()
Example #10
0
File: ext.py Project: niziou/wdb
 def stop(self):
     stop_trace(sys._getframe().f_back)
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()
Example #12
0
File: ext.py Project: minisin/wdb
 def stop(self):
     stop_trace(sys._getframe().f_back)