#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributors.


from fenrirscreenreader.core.i18n import _


class command:
    def __init__(self):
        pass

    def initialize(self, environment):
        self.env = environment

    def shutdown(self):
        pass

    def get_description(self):
        return _("Interrupts the current presentation")

    def run(self):
        if len(self.env["input"]["prev_deepest_input"]) > len(
            self.env["input"]["curr_input"]
        ):
            return
        self.env["runtime"]["OutputManager"].interrupt_output()

    def set_callback(self, callback):
        pass
