def __init__(self, filename):
        """Initialize writer with a file descriptor."""

        self._data = None
        self._data_queue = deque()
        self._file = filename
        self._fd = None
        self._timer = None

        try:
            self._open_file()
        except __HOLE__, (errno, errmsg):
            raise errors.InitError("Failed to open nagios pipe %s: %s"
                    % (self._file, errmsg))

        reactor.addSystemEventTrigger('after', 'shutdown', self.shutdown)
dataset/ETHPy150Open marineam/nagcat/python/nagcat/nagios_api.py/NagiosWriter.__init__