def _check_available_space(self): """Check available space on device If the available space is below threshold an alert will be shown which suggests deleting old journal entries. """ if self._critical_space_alert: return stat = os.statvfs(env.get_profile_path()) free_space = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL] if free_space < (_SPACE_THRESHOLD * 1024 * 1024): self._critical_space_alert = ModalAlert() self._critical_space_alert.connect('destroy', self.__alert_closed_cb) self._critical_space_alert.show()