ts3.escape

This module contains classes and functions used to build valid query strings and to unescape responses.

Changed in version 2.0.0: The TS3Escape class has been replaced by the escape() and unescape() functions, because most of its methods became obsolete with the introduction of the TS3QueryBuilder.

ts3.escape.escape(value)[source]

Escapes the value as required by the Server Query Manual:

>>> escape('Hello World')
'Hello\sWorld'
>>> escape('TeamSpeak ]|[ Server')
'TeamSpeak\s]\p[\sServer'
Seealso:unescape()
ts3.escape.unescape(value)[source]

Undo the escaping used for transport:

>>> unescape('Hello\sWorld')
'Hello World'
>>> unescape('TeamSpeak\s]\p[\sServer')
'TeamSpeak ]|[ Server'