Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/protocols/__pycache__/memcache.cpython-39.pyc
Ðазад
a k�hc\ � @ s� d Z ddlmZ ddlmZmZmZ ddlmZ ddl m Z ddlmZ ddl mZmZ dZG d d � d e�ZG dd� de�ZG d d� de�ZG dd� d�ZG dd� dee �Zg d�ZdS )ap Memcache client protocol. Memcached is a caching server, storing data in the form of pairs key/value, and memcache is the protocol to talk with it. To connect to a server, create a factory for L{MemCacheProtocol}:: from twisted.internet import reactor, protocol from twisted.protocols.memcache import MemCacheProtocol, DEFAULT_PORT d = protocol.ClientCreator(reactor, MemCacheProtocol ).connectTCP("localhost", DEFAULT_PORT) def doSomething(proto): # Here you call the memcache operations return proto.set("mykey", "a lot of data") d.addCallback(doSomething) reactor.run() All the operations of the memcache protocol are present, but L{MemCacheProtocol.set} and L{MemCacheProtocol.get} are the more important. See U{http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt} for more information about the protocol. � )�deque)�Deferred�TimeoutError�fail)�LineReceiver)�TimeoutMixin)�log)�nativeString� networkStringi�+ c @ s e Zd ZdZdS )� NoSuchCommandzA Exception raised when a non existent command is called. N��__name__� __module__�__qualname__�__doc__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/protocols/memcache.pyr ( s r c @ s e Zd ZdZdS )�ClientErrorz1 Error caused by an invalid client call. Nr r r r r r . s r c @ s e Zd ZdZdS )�ServerErrorz* Problem happening on the server. Nr r r r r r 4 s r c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �Commanda8 Wrap a client action into an object, that holds the values used in the protocol. @ivar _deferred: the L{Deferred} object that will be fired when the result arrives. @type _deferred: L{Deferred} @ivar command: name of the command sent to the server. @type command: L{bytes} c K s0 || _ t� | _|�� D ]\}}t| ||� qdS )z� Create a command. @param command: the name of the command. @type command: L{bytes} @param kwargs: this values will be stored as attributes of the object for future use N)�commandr � _deferred�items�setattr)�selfr �kwargs�k�vr r r �__init__G s zCommand.__init__c C s | j �|� dS )zB Shortcut method to fire the underlying deferred. N)r �callback)r �valuer r r �successV s zCommand.successc C s | j �|� dS )z5 Make the underlying deferred fails. N)r Zerrback)r �errorr r r r \ s zCommand.failN)r r r r r r! r r r r r r : s r c @ sT e Zd ZdZdZdZdRdd�Zdd� Zd d � Zdd� Z d d� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� ZdSd.d/�ZdTd0d1�Zd2d3� ZdUd5d6�ZdVd7d8�ZdWd9d:�ZdXd;d<�Z d=d>� Z!d?d@� Z"dAdB� Z#dYdCdD�Z$dZdEdF�Z%dGdH� Z&d[dJdK�Z'dLdM� Z(dNdO� Z)dPdQ� Z*dIS )\�MemCacheProtocola1 MemCache protocol: connect to a memcached server to store/retrieve values. @ivar persistentTimeOut: the timeout period used to wait for a response. @type persistentTimeOut: L{int} @ivar _current: current list of requests waiting for an answer from the server. @type _current: L{deque} of L{Command} @ivar _lenExpected: amount of data expected in raw mode, when reading for a value. @type _lenExpected: L{int} @ivar _getBuffer: current buffer of data, used to store temporary data when reading in raw mode. @type _getBuffer: L{list} @ivar _bufferLength: the total amount of bytes in C{_getBuffer}. @type _bufferLength: L{int} @ivar _disconnected: indicate if the connectionLost has been called or not. @type _disconnected: L{bool} � F�<