ATLAS Offline Software
Functions | Variables
python.trfSignal Namespace Reference

Functions

def setTrfSignalHandlers (handler)
 Install common handler for various signals. More...
 
def resetTrfSignalHandlers ()
 Restore signal handlers to the default ones. More...
 

Variables

 msg
 
 _savedSignalHandlerDict
 
 _defaultSignalList
 

Function Documentation

◆ resetTrfSignalHandlers()

def python.trfSignal.resetTrfSignalHandlers ( )

Restore signal handlers to the default ones.

Handlers are restored from _defaultSignalHandlerDict dictionary.

Returns
None

Definition at line 40 of file trfSignal.py.

41  for s in _defaultSignalList:
42  try:
43  signal.signal(getattr(signal, s), _savedSignalHandlerDict.get(s, signal.SIG_DFL))
44  except Exception as e:
45  msg.error("Unable to attach custom signal handler to %s: %s", s, e)
46  continue

◆ setTrfSignalHandlers()

def python.trfSignal.setTrfSignalHandlers (   handler)

Install common handler for various signals.

All existing signal handlers are saved in the _trfSignalHandlerDict dictionary to allow for them to be restored.

Parameters
handlerCommon signal handler for all signals concerned.
Returns
None

Definition at line 28 of file trfSignal.py.

28 def setTrfSignalHandlers(handler):
29  for s in _defaultSignalList:
30  try:
31  msg.debug("Setting signalhandler for %s to %s", s, handler)
32  _savedSignalHandlerDict[s] = signal.signal(getattr(signal, s), handler)
33  except Exception as e:
34  msg.error("Unable to attach custom signal handler to %s: %s", s, e)
35  continue
36 

Variable Documentation

◆ _defaultSignalList

python.trfSignal._defaultSignalList
private

Definition at line 22 of file trfSignal.py.

◆ _savedSignalHandlerDict

python.trfSignal._savedSignalHandlerDict
private

Definition at line 16 of file trfSignal.py.

◆ msg

python.trfSignal.msg

Definition at line 14 of file trfSignal.py.

python.trfSignal.resetTrfSignalHandlers
def resetTrfSignalHandlers()
Restore signal handlers to the default ones.
Definition: trfSignal.py:40
python.trfSignal.setTrfSignalHandlers
def setTrfSignalHandlers(handler)
Install common handler for various signals.
Definition: trfSignal.py:28