'Handle a finished signal from the process.'

def _on_finished(self):

    if self.closing:
        return
    if self.is_initialized:
        debug_print(('Restarting    %s' % self.name))
        debug_print(self.process.readAllStandardOutput())
        debug_print(self.process.readAllStandardError())
        self.is_initialized = False
        self.notifier.setEnabled(False)
        self.run()
    else:
        debug_print(('Errored    %s' % self.name))
        debug_print(self.process.readAllStandardOutput())
        debug_print(self.process.readAllStandardError())
        self.errored.emit()
