Source code for jupy4syn.commands.ICommand

from abc import ABC, abstractmethod

[docs]class ICommand(ABC):
[docs] @abstractmethod def exec(self, parameters): """ Abstract method to execute the command. Parameters ---------- parameters : :obj:`str` or :obj:`list` The parameters that will be sent to execution as a shell argument Returns ------- None """ raise NotImplementedError
[docs] @abstractmethod def args(self, initial_args): """ Abstract method to get initial arguments of the command. These arguments will be show at the text box (if the text box is enabled for this command, see :py:meth:`.show`). Parameters ---------- initial_args : :obj:`str` or :obj:`list` The initial arguments that will be show in the text box and will be sent to execution as shell arguments Returns ------- out : :obj:`str` Returns a single string with the arguments or its representation """ raise NotImplementedError
[docs] @abstractmethod def text_box(self, initial_args): """ Abstract method check if the command will need a text box and if its text can be modified. Parameters ---------- initial_args : :obj:`str` or :obj:`list` The initial arguments that will be used to check if a text box will be needed. Returns ------- out : :obj:`tuple` of :obj:`bool` Returns (True, True) if a text box will be needed and if its text can be modified. """ raise NotImplementedError