String Quoting

String quoting and dequoting support.

kmd.completions.quoting.backslash_dequote(text, chars='')

Backslash-dequote ‘text’. If ‘chars’ is given, only characters in ‘chars’ are dequoted.

kmd.completions.quoting.backslash_quote(text, chars='')

Backslash-quote ‘text’. If ‘chars’ is given, only characters in ‘chars’ are quoted.

kmd.completions.quoting.is_fully_quoted(text)

Return True if all rl.completer.filename_quote_characters in ‘text’ are backslash-quoted.

kmd.completions.quoting.char_is_quoted(text, index)

Return True if the character at ‘index’ is quoted.

kmd.completions.quoting.dequote_string(text, quote_char='')

Return a backslash-dequoted version of ‘text’. If ‘quote_char’ is the single-quote, backslash-dequoting is limited to single-quotes.

kmd.completions.quoting.quote_string(text, single_match=True, quote_char='')

Return a quote-char quoted version of ‘text’. If ‘single_match’ is False, the quotes are not closed. The default ‘quote_char’ is the first character in rl.completer.quote_characters.

kmd.completions.quoting.backslash_quote_string(text, single_match=True, quote_char='')

Return a backslash-quoted version of ‘text’. If a ‘quote_char’ is given, behave like quote_string().

Previous topic

Command Completion

Next topic

Filename Quoting