Exemplo n.º 1
0
def handle_keyboardinterrupt(w3af_core):
    # Kills some threads from the GUI, not from the core
    helpers.end_threads()
        
    w3af_core.quit()

    import threading
    import pprint
    
    def nice_repr(alive_threads):
        repr_alive = [repr(x) for x in alive_threads]
        repr_alive.sort()
        return pprint.pformat(repr_alive)
    print nice_repr(threading.enumerate())
        
    om.out.set_output_plugins(['console'])
    om.out.console(_('\nStopping after Ctrl+C. Thanks for using w3af, bye!'))
    om.out.process_all_messages()
     
    # 130 seems to be the correct exit code for this case
    # http://tldp.org/LDP/abs/html/exitcodes.html
    sys.exit(130)
Exemplo n.º 2
0
 def _handle_cancel(self, *args):
     end_threads()
     self.destroy()
Exemplo n.º 3
0
 def _handle_cancel(self, *args):
     end_threads()
     self.destroy()