55ok

Mini

Direktori : /proc/thread-self/root/lib/python2.7/site-packages/pymysql/
Upload File :
Current File : //proc/thread-self/root/lib/python2.7/site-packages/pymysql/_socketio.pyo

�
s��Tc@sidZddlTddlZddlZdgZejZejejfZdej	fd��YZ
dS(s}
SocketIO imported from socket module in Python 3.

Copyright (c) 2001-2013 Python Software Foundation; All Rights Reserved.
i����(t*NtSocketIOcBsteZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
d��Ze
d	��Zd
�Z
RS(s�Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    cCs�|d	krtd|��ntjj|�||_d|krQ|d7}n||_d|k|_d|k|_t|_	dS(
Ntrtwtrwtrbtwbtrwbsinvalid mode: %rtb(RRRRRR(
t
ValueErrortiot	RawIOBaset__init__t_sockt_modet_readingt_writingtFalset_timeout_occurred(tselftsocktmode((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyR!s	
	cCs�|j�|j�|jr,td��nx�tr�y|jj|�SWq/tk
rht|_�q/tk
r�}|j	d}|t
kr�q/n|tkr�dS�q/Xq/WdS(s3Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        s!cannot read from timed out objectiN(
t_checkClosedt_checkReadableRtIOErrortTrueR
t	recv_intottimeoutterrortargstEINTRt_blocking_errnostNone(RRtetn((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pytreadinto-s"

		
	
cCs\|j�|j�y|jj|�SWn-tk
rW}|jdtkrQdS�nXdS(sWrite the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        iN(Rt_checkWritableR
tsendRRRR (RRR!((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pytwriteGs

cCs|jrtd��n|jS(s2True if the SocketIO is open for reading.
        sI/O operation on closed socket.(tclosedR	R(R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pytreadableWs	cCs|jrtd��n|jS(s2True if the SocketIO is open for writing.
        sI/O operation on closed socket.(R'R	R(R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pytwritable^s	cCs%|jrtd��nt�j�S(s2True if the SocketIO is open for seeking.
        sI/O operation on closed socket.(R'R	tsupertseekable(R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyR+es	cCs|j�|jj�S(s=Return the file descriptor of the underlying socket.
        (RR
tfileno(R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyR,ls
cCs|js|j�SdSdS(Ni����(R'R,(R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pytnamers	
cCs|jS(N(R(R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyRyscCs7|jr
dStjj|�|jj�d|_dS(s�Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        N(R'R
RtcloseR
t_decref_socketiosR (R((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyR.}s
	
(t__name__t
__module__t__doc__RR#R&R(R)R+R,tpropertyR-RR.(((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyRs							(R2tsocketR
terrnot__all__RtEAGAINtEWOULDBLOCKRRR(((s5/usr/lib/python2.7/site-packages/pymysql/_socketio.pyt<module>s
		

Zerion Mini 1.0