(cls, parameters)
return tmp
Escapes the parameters of a TS3 query and encodes it as a part
        of a valid ts3 query string.

        >>> # None
        >>> TS3Escape.escape_parameters(None)
        ''
        >>> # key -> str
        >>> TS3Escape.escape_parameters({'virtualserver_name': 'foo bar'})
        'virtualserver_name=foo\\\sbar'
        >>> # key -> None
        >>> TS3Escape.escape_parameters({"permsid": None})
        ''
        >>> # Of course, you can mix them:
        >>> TS3Escape.escape_parameters(
        ...     {'virtualserver_name': 'foo bar',
        ...      'permsid': None}
        ...     )
        'virtualserver_name=foo\\\sbar'

        :arg parameters: The dictionary with the key value pairs.
        :type parameters: dictionary
Escapes the parameters of a TS3 query and encodes it as a part
        of a valid ts3 query string.
Escapes the parameters of a TS3 query and encodes it as a part of a valid ts3 query string .
def escape_parameters(cls, parameters):
        """
        Escapes the parameters of a TS3 query and encodes it as a part
        of a valid ts3 query string.

        >>> # None
        >>> TS3Escape.escape_parameters(None)
        ''
        >>> # key -> str
        >>> TS3Escape.escape_parameters({'virtualserver_name': 'foo bar'})
        'virtualserver_name=foo\\\sbar'
        >>> # key -> None
        >>> TS3Escape.escape_parameters({"permsid": None})
        ''
        >>> # Of course, you can mix them:
        >>> TS3Escape.escape_parameters(
        ...     {'virtualserver_name': 'foo bar',
        ...      'permsid': None}
        ...     )
        'virtualserver_name=foo\\\sbar'

        :arg parameters: The dictionary with the key value pairs.
        :type parameters: dictionary
        """
        if parameters is None:
            return str()

        tmp = list()
        for key, val in parameters.items():
            if val is None:
                continue
            # Note, that escaping a key will never make it valid or invalid.
            # In other words: It's not necessairy to escape the key.
            key = key.lower()
            val = cls.escape(val)
            # if the key is empty => do not add an equal sign
            # this allows unnamed parameters
            if key:
                tmp.append(key + "=" + val)
            else:
                tmp.append(val)
        tmp = " ".join(tmp)
        return tmp
def escape_parameters ( cls , parameters ) : if parameters is None : return str ( ) tmp = list ( ) for key , val in parameters . items ( ) : if val is None : continue # Note, that escaping a key will never make it valid or invalid. # In other words: It's not necessairy to escape the key. key = key . lower ( ) val = cls . escape ( val ) # if the key is empty => do not add an equal sign # this allows unnamed parameters if key : tmp . append ( key + "=" + val ) else : tmp . append ( val ) tmp = " " . join ( tmp ) return tmp