Python signal.__dict__() Examples
The following are 3
code examples of signal.__dict__().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
signal
, or try the search function
.
Example #1
Source File: crond.py From collection with MIT License | 6 votes |
def signal_initialize(): import signal signal.signal(signal.SIGTERM, sig_exit) signal.signal(signal.SIGINT, sig_exit) signal.signal(signal.SIGABRT, sig_exit) if 'SIGQUIT' in signal.__dict__: signal.signal(signal.SIGQUIT, sig_exit) if 'SIGCHLD' in signal.__dict__: signal.signal(signal.SIGCHLD, sig_chld) if 'SIGPIPE' in signal.__dict__: signal.signal(signal.SIGPIPE, signal.SIG_IGN) return 0 #---------------------------------------------------------------------- # logs #----------------------------------------------------------------------
Example #2
Source File: process.py From ryu with Apache License 2.0 | 5 votes |
def _signal_status_msg(type_, signr): s = "%s by signal %d" % (type_, signr) for name in signal.__dict__: if name.startswith("SIG") and getattr(signal, name) == signr: return "%s (%s)" % (s, name) return s
Example #3
Source File: sigprotect.py From conary with Apache License 2.0 | 5 votes |
def __str__(self): for name, val in signal.__dict__.iteritems(): if name.startswith('SIG') and val == self.sigNum: break if val == self.sigNum: return 'SignalException: signal %s received' % name else: return 'SignalException: signal %d received' % self.sigNum