Beispiel #1
0
 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)
Beispiel #2
0
 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))
Beispiel #3
0
def test_quote_unquote_cycle(s):
    assert command_lexer.unquote(command_lexer.quote(s)) == s
Beispiel #4
0
def test_quote_unquote_cycle(s):
    assert command_lexer.unquote(command_lexer.quote(s)).replace(r"\x22",
                                                                 '"') == s