def console_command(self, *command_str: str) -> None: """ Prompt the user to edit a command with a (possibly empty) starting value. """ quoted = " ".join(command_lexer.quote(x) for x in command_str) if quoted: quoted += " " signals.status_prompt_command.send(partial=quoted)
def callback(opt): # We're now outside of the call context... repl = " ".join(command_lexer.quote(x) for x in args) repl = repl.replace("{choice}", opt) try: self.master.commands.execute(subcmd + " " + repl) except exceptions.CommandError as e: signals.status_message.send(message=str(e))
def test_quote_unquote_cycle(s): assert command_lexer.unquote(command_lexer.quote(s)) == s
def test_quote_unquote_cycle(s): assert command_lexer.unquote(command_lexer.quote(s)).replace(r"\x22", '"') == s