HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: //usr/local/lib/python3.6/site-packages/bmemcached/client/__pycache__/mixin.cpython-36.pyc
3

�':f��@sDddlZddlmZmZddlmZddlmZGdd�de�Z	dS)�N)�PICKLE_PROTOCOL�SOCKET_TIMEOUT)�pickle)�Protocolc	@s�eZdZdZd+dddeeejejdf	dd�Z	e
dd��Zdd	�Zd,dd�Z
d-d
d�Zdd�Zd.dd�Zdd�Zd/dd�Zd1dd�Zd3dd�Zd5dd�Zd7dd �Zd9d!d"�Zd:d#d$�Zd%d&�Zd'd(�Zd)d*�ZdS);�ClientMixina Client mixin with basic commands.

    :param servers: A list of servers with ip[:port] or unix socket.
    :type servers: list
    :param username: If your server requires SASL authentication, provide the username.
    :type username: six.string_types
    :param password: If your server requires SASL authentication, provide the password.
    :type password: six.string_types
    :param compression: This memcached client uses zlib compression by default,
        but you can change it to any Python module that provides
        `compress` and `decompress` functions, such as `bz2`.
    :type compression: Python module
    :param socket_timeout: The timeout applied to memcached connections.
    :type socket_timeout: float
    :param pickle_protocol: The pickling protocol to use, 0-5. See
        https://docs.python.org/3/library/pickle.html#data-stream-format
        default is 0 (human-readable, original format).
    :type pickle_protocol: int
    :param pickler: Use this to replace the object serialization mechanism.
    :type pickler: function
    :param unpickler: Use this to replace the object deserialization mechanism.
    :type unpickler: function
    :param tls_context: A TLS context in order to connect to TLS enabled
        memcached servers.
    :type tls_context: ssl.SSLContext
    �127.0.0.1:11211Nc

Cs>||_||_||_||_||_||_||_|	|_|j|�dS)N)	�username�password�compression�socket_timeout�pickle_protocol�pickler�	unpickler�tls_context�set_servers)
�self�serversrr	r
rrr
rr�r�J/tmp/pip-build-5ba02zx6/python-binary-memcached/bmemcached/client/mixin.py�__init__#s	zClientMixin.__init__ccsx|jD]
}|VqWdS)N)�_servers)r�serverrrrr6szClientMixin.serverscs6t|tj�r|g}|std���fdd�|D��_dS)z�
        Iter to a list of servers and instantiate Protocol class.

        :param servers: A list of servers
        :type servers: list
        :return: Returns nothing
        :rtype: None
        zNo memcached servers suppliedc
s6g|].}t|�j�j�j�j�j�j�j�jd�	�qS))	rrr	r
rrr
rr)	rrr	r
rrr
rr)�.0r)rrr�
<listcomp>Hs
z+ClientMixin.set_servers.<locals>.<listcomp>N)�
isinstance�six�string_types�AssertionErrorr)rrr)rrr;s
	

zClientMixin.set_serversrcCs,g}x|jD]}|j|j|��qWt|�S)z�
        Send a command to server flush|delete all keys.

        :param time: Time to wait until flush in seconds.
        :type time: int
        :return: True in case of success, False in case of failure
        :rtype: bool
        )r�append�	flush_all�any)r�time�returnsrrrrrTs	zClientMixin.flush_allcCs(i}x|jD]}|j|�||j<qW|S)z�
        Return server stats.

        :param key: Optional if you want status from a key.
        :type key: six.string_types
        :return: A dict with server stats
        :rtype: dict
        )r�statsr)r�keyr"rrrrr#cszClientMixin.statscCsx|jD]}|j�qWdS)zX
        Disconnect all servers.

        :return: Nothing
        :rtype: None
        N)rZ
disconnect)rrrrr�disconnect_alltszClientMixin.disconnect_allFcCs
t��dS)N)�NotImplementedError)rr$�default�get_casrrr�get~szClientMixin.getcCs
t��dS)N)r&)rr$rrr�gets�szClientMixin.getscCs
t��dS)N)r&)r�keysr(rrr�	get_multi�szClientMixin.get_multi�cCs
t��dS)N)r&)rr$�valuer!�compress_levelrrr�set�szClientMixin.setcCs
t��dS)N)r&)rr$r.�casr!r/rrrr1�szClientMixin.cascCs
t��dS)N)r&)rZmappingsr!r/rrr�	set_multi�szClientMixin.set_multicCs
t��dS)N)r&)rr$r.r!r/rrr�add�szClientMixin.addcCs
t��dS)N)r&)rr$r.r!r/rrr�replace�szClientMixin.replacecCs
t��dS)N)r&)rr$r1rrr�delete�szClientMixin.deletecCs
t��dS)N)r&)rr+rrr�delete_multi�szClientMixin.delete_multicCs
t��dS)N)r&)rr$r.rrr�incr�szClientMixin.incrcCs
t��dS)N)r&)rr$r.rrr�decr�szClientMixin.decr)r)r)N)NF)F���)rr9r9)rr9r9)rr9r9)rr9r9)rr9)r)�__name__�
__module__�__qualname__�__doc__rrr�Pickler�	Unpicklerr�propertyrrrr#r%r)r*r,r0r1r2r3r4r5r6r7r8rrrrrs6










r)
rZbmemcached.client.constantsrrZbmemcached.compatrZbmemcached.protocolr�objectrrrrr�<module>s