class documentation

class SignalHandler(object):

View In Hierarchy

Generic signal handler class.

It automatically restores the original handler when deconstructed or when Reset is called. You can either pass your own handler function in or query the called attribute to detect whether the signal was sent.

Method __del__ Undocumented
Method __init__ Constructs a new SignalHandler instance.
Method Clear Unsets the called flag.
Method Reset Restore previous handler.
Method SetHandlerFn Set the signal handling function
Instance Variable called tracks whether any of the signals have been raised
Instance Variable signum the signals we handle
Method _HandleSignal Actual signal handling function.
Instance Variable _handler_fn Undocumented
Instance Variable _previous Undocumented
Instance Variable _wakeup Undocumented
def __del__(self):

Undocumented

def __init__(self, signum, handler_fn=None, wakeup=None):

Constructs a new SignalHandler instance.

Parameters
signum:int or list of intsSingle signal number or set of signal numbers
handler_fn:callableSignal handling function
wakeupUndocumented
def Clear(self):

Unsets the called flag.

This function can be used in case a signal may arrive several times.

def Reset(self):

Restore previous handler.

This will reset all the signals to their previous handlers.

def SetHandlerFn(self, fn):

Set the signal handling function

called: boolean =

tracks whether any of the signals have been raised

signum: list =

the signals we handle

def _HandleSignal(self, signum, frame):

Actual signal handling function.

_handler_fn =

Undocumented

_previous: dict =

Undocumented

_wakeup =

Undocumented