How to use the pudb.set_interrupt_handler function in pudb

To help you get started, we’ve selected a few pudb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saga-project / BigJob / tests / test_pty_exhaustion.py View on Github external
""" Example application demonstrating job submission via bigjob 

    DON'T EDIT THIS FILE (UNLESS THERE IS A BUG)

    THIS FILE SHOULD NOT BE COMMITTED TO SVN WITH USER-SPECIFIC PATHS!
"""
import os
import time
import pdb
import sys
import saga

try :
    import pudb
    pudb.set_interrupt_handler()
except :
    pass

# configuration
""" This variable defines the coordination system that is used by BigJob
    e.g. 
        advert://localhost (SAGA/Advert SQLITE)
        advert://advert.cct.lsu.edu:8080 (SAGA/Advert POSTGRESQL)
        redis://localhost:6379 (Redis at localhost)
        tcp://localhost (ZMQ)
        tcp://* (ZMQ - listening to all interfaces)
"""

#COORDINATION_URL = "advert://localhost/?dbtype=sqlite3"
#COORDINATION_URL = "tcp://*"
COORDINATION_URL = "redis://10.0.1.18:6379"
github radical-cybertools / radical.saga / tests / issues / issue_114.py View on Github external
import sys
import radical.saga as saga

import pudb; pudb.set_interrupt_handler()

def main () :

    try:
        i  = 0
        js = saga.job.Service ("fork://localhost/")

        while True :

            i = i+1
            j = js.run_job ("/bin/true")

            print("%5d : %-30s : %s" % (i, j.id, j.state))

            j.wait ()
github radical-cybertools / radical.saga / tests / issues / issue_104.py View on Github external
import os
import sys
import radical.saga as saga

import pudb; pudb.set_interrupt_handler()

USER_ID     = "merzky"
REMOTE_HOST = "ssh://gw68.quarry.iu.teragrid.org"
REMOTE_HOST = "fork://localhost"

def main () :
    try:

        for i in range(0, 1000):
            print(("**************************** Job: %d *****************************" % i))
            ctx = saga.Context("ssh")
            ctx.user_id = USER_ID

            session = saga.Session()
            session.add_context(ctx)
github saga-project / BigJob / tests / test_connection_pooling.py View on Github external
import os
import time
import pilot

try:
    import pudb
    pudb.set_interrupt_handler()
except:
    pass

#########################################################################
##
redis_password = os.environ.get('REDIS_PASSWORD')
COORD    = "redis://%s@gw68.quarry.iu.teragrid.org:6379" % redis_password
HOST     = "ssh://localhost"
##
#########################################################################

N     = 20
pjs   = []
start = time.time()
total = 0.0
github inducer / pudb / pudb / debugger.py View on Github external
# When bdb sets tracing, a number of call and line events happens
        # BEFORE debugger even reaches user's code (and the exact sequence of
        # events depends on python version). So we take special measures to
        # avoid stopping before we reach the main script (see user_line and
        # user_call for details).
        self._wait_for_mainpyfile = 1
        self.mainpyfile = self.canonic(filename)
        if PY3:
            statement = 'exec(compile(open("%s").read(), "%s", "exec"))' % (
                    filename, filename)
        else:
            statement = 'execfile( "%s")' % filename

        # Set up an interrupt handler
        from pudb import set_interrupt_handler
        set_interrupt_handler()

        # Implicitly runs in the namespace of __main__.
        self.run(statement)
github inducer / pudb / pudb / b.py View on Github external
def set_trace():
    dbg = _get_debugger()
    set_interrupt_handler()
    dbg.set_trace(sys._getframe().f_back.f_back)