Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
‡ƛYc@@sddlmZmZddlmZddlZddlZddlmZm	Z	m
Z
ddlmZej
ddd	ejejBƒZd
efd„ƒYZdefd
„ƒYZdeefd„ƒYZdefd„ƒYZdeefd„ƒYZdS(i(tprint_functiontabsolute_import(tpartialNi(t
range_typet	text_typetPY2(terrs'\s*((?:INSERT|REPLACE)\s.+\sVALUES?\s+)s6(\(\s*(?:%s|%\(.+\)s)\s*(?:,\s*(?:%s|%\(.+\)s)\s*)*\))s(\s*(?:ON DUPLICATE.*)?);?\s*\ZtCursorcB@sseZdZdZeZd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zed„Zd„Zdd
„Zd„Zdd„Zdd„Zd„Zd„Zdd„Zd„Zdd„Zd„Zdd„Zd„Zd„Zd„Zd„Z e!j"Z"e!j#Z#e!j$Z$e!j%Z%e!j&Z&e!j'Z'e!j(Z(e!j)Z)e!j*Z*e!j+Z+RS(sC
    This is the object you use to interact with the database.
    i cC@sU||_d|_d|_d|_d|_d|_d|_d|_t	|_
dS(so
        Do not create an instance of a Cursor yourself. Call
        connections.Connection.cursor().
        iiÿÿÿÿiN(t
connectiontNonetdescriptiont	rownumbertrowcountt	arraysizet	_executedt_resultt_rowstFalset_warnings_handled(tselfR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt__init__"s								cC@sA|j}|dkrdSzx|jƒr.qWWdd|_XdS(sD
        Closing a cursor just exhausts all remaining data.
        N(RR	tnextset(Rtconn((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytclose1s	cC@s|S(N((R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt	__enter__>scG@s~|jƒdS(N(R(Rtexc_info((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt__exit__AscC@s"|jstjdƒ‚n|jS(Ns
Cursor closed(RRtProgrammingError(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt_get_dbEs	cC@s|jstjdƒ‚ndS(Nsexecute() first(RRR(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt_check_executedJs	cC@s|S(N((Rtrow((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt	_conv_rowNscG@sdS(s!Does nothing, required by DB API.N((Rtargs((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt
setinputsizesQscG@sdS(s!Does nothing, required by DB API.N((RR ((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytsetoutputsizesTscC@sr|jƒ}|j}|r(|jƒn|dksC||jk	rGdS|jsTdS|jd|ƒ|jƒtS(sGet the next query sett
unbufferedN(RRt_show_warningsR	thas_nexttnext_resultt_do_get_resulttTrue(RR#Rtcurrent_result((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt_nextsetWs	
	
cC@s
|jtƒS(N(R*R(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRfsc@sbt|tƒr!|jˆƒ}n=t|ttfƒr^t|ƒ‡‡fd†|Dƒƒ}n|S(Nc3@s$|]}ˆj|dˆƒVqdS(tencodingN(t
_ensure_bytes(t.0tv(R+R(sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pys	<genexpr>ms(t
isinstanceRtencodettupletlistttype(RtxR+((R+RsD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR,is
(c@såt|jdˆjƒ‰t|ttfƒretrKttˆ|ƒƒ}nt‡fd†|DƒƒSt|tƒr¿trŸt‡fd†|j	ƒDƒƒ}nt‡fd†|j	ƒDƒƒStrԈ|ƒ}nˆj
|ƒSdS(NR+c3@s|]}ˆj|ƒVqdS(N(tliteral(R-targ(R(sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pys	<genexpr>vsc3@s-|]#\}}ˆ|ƒˆ|ƒfVqdS(N((R-tkeytval(tensure_bytes(sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pys	<genexpr>ysc3@s*|] \}}|ˆj|ƒfVqdS(N(R5(R-R7R8(R(sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pys	<genexpr>{s(RR,R+R/R1R2Rtmaptdicttitemstescape(RR R((RR9sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt_escape_argsps cC@sV|jƒ}tr-|j|d|jƒ}n|dk	rR||j||ƒ}n|S(sÂ
        Returns the exact string that is sent to the database by calling the
        execute() method.

        This method follows the extension to the DB API 2.0 followed by Psycopg.
        R+N(RRR,R+R	R>(RtqueryR R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytmogrifyƒscC@sAx|jƒrqW|j||ƒ}|j|ƒ}||_|S(sŠExecute a query

        :param str query: Query to execute.

        :param args: parameters used with query. (optional)
        :type args: tuple, list or dict

        :return: Number of affected rows
        :rtype: int

        If args is a list or tuple, %s can be used as a placeholder in the query.
        If args is a dict, %(name)s can be used as a placeholder in the query.
        (RR@t_queryR(RR?R tresult((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytexecute“s	c	@sÓ|s
dStjˆƒ}|rª|jdƒd}|jdƒjƒ}|jdƒpYd}|ddkr||dd	ks‚t‚ˆj||||ˆjˆjƒjƒSt	‡‡fd
†|Dƒƒˆ_
ˆj
S(s€Run several data against one query

        :param query: query to execute on server
        :param args:  Sequence of sequences or mappings.  It is used as parameter.
        :return: Number of rows affected, if any.

        This method improves performance on multiple-row INSERT and
        REPLACE. Otherwise it is equivalent to looping over args with
        execute().
        Niiitit(iÿÿÿÿt)c3@s!|]}ˆjˆ|ƒVqdS(N(RC(R-R6(R?R(sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pys	<genexpr>Ãs((tRE_INSERT_VALUEStmatchtgrouptrstriptAssertionErrort_do_execute_manytmax_stmt_lengthRR+tsumR(RR?R tmtq_prefixtq_valuest	q_postfix((R?RsD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytexecutemanyªs&"c
C@sã|jƒ}|j}t|tƒr6|j|ƒ}ntr]t|tƒr]|j|ƒ}nt|tƒr~|j|ƒ}nt|ƒ}	t|ƒ}||t|ƒ|ƒ}
t|
tƒrëtrÖ|
j|ƒ}
që|
j|dƒ}
n|	|
7}	d}xÁ|D]¹}||||ƒ}
t|
tƒrWtrB|
j|ƒ}
qW|
j|dƒ}
nt	|	ƒt	|
ƒt	|ƒd|kr§||j
|	|ƒ7}t|ƒ}	n
|	d7}	|	|
7}	qW||j
|	|ƒ7}||_|S(Ntsurrogateescapeiit,(RR>R/RR0Rt	bytearraytitertnexttlenRCR(
RtprefixtvaluestpostfixR RMR+RR=tsqlR.trowsR6((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRLÆs>	

*
	cC@s¸|jƒ}xMt|ƒD]?\}}d|||j|ƒf}|j|ƒ|jƒqWd|djgtt|ƒƒD]}d||f^q{ƒf}|j|ƒ||_|S(sExecute stored procedure procname with args

        procname -- string, name of procedure to execute on server

        args -- Sequence of parameters to use with procedure

        Returns the original args.

        Compatibility warning: PEP-249 specifies that any modified
        parameters must be returned. This is currently impossible
        as they are only available by storing them in a server
        variable and then retrieved by a query. Since stored
        procedures return zero or more result sets, there is no
        reliable way to get at OUT or INOUT parameters via callproc.
        The server variables are named @_procname_n, where procname
        is the parameter above and n is the position of the parameter
        (from zero). Once all result sets generated by the procedure
        have been fetched, you can issue a SELECT @_procname_0, ...
        query using .execute() to get any OUT or INOUT values.

        Compatibility warning: The act of calling a stored procedure
        itself creates an empty result set. This appears after any
        result sets generated by the procedure. This is non-standard
        behavior with respect to the DB-API. Be sure to use nextset()
        to advance through all result sets; otherwise you may get
        disconnected.
        sSET @_%s_%d=%ssCALL %s(%s)RUs@_%s_%d(	Rt	enumerateR=RARtjoinRRYR(RtprocnameR RtindexR6tqti((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytcallprocês
	3
	cC@sX|jƒ|jdks1|jt|jƒkr5dS|j|j}|jd7_|S(sFetch the next rowiN(RRR	RRY(RRB((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytfetchones
'cC@se|jƒ|jdkrdS|j|p/|j}|j|j|!}t|t|jƒƒ|_|S(sFetch several rowsN((RRR	RR
tminRY(RtsizetendRB((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt	fetchmanys
cC@sX|jƒ|jdkrdS|jr9|j|j}n	|j}t|jƒ|_|S(sFetch all the rowsN((RRR	RRY(RRB((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytfetchall&s
		trelativecC@s|jƒ|dkr&|j|}n(|dkr;|}ntjd|ƒ‚d|kont|jƒkns‚tdƒ‚n||_dS(NRltabsolutesunknown scroll mode %sisout of range(RRRRRYRt
IndexError(Rtvaluetmodetr((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pytscroll2s
	%cC@s3|jƒ}||_|j|ƒ|jƒ|jS(N(Rt_last_executedR?R'R(RRcR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRA?s
	

cC@sx|jƒ}d|_|j|_}|j|_|j|_|j|_|j|_	t
|_|jst|j
ƒndS(Ni(RRRt
affected_rowsRR
t	insert_idt	lastrowidR^RRRt_defer_warningsR$(RRRB((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR'Fs			cC@sÍ|jr
dSt|_|jr<|jjs8|jjr<dS|jƒjƒ}|dkr^dSxh|D]`}|d}tr¢t	|t
ƒr¢|jddƒ}q¢ntj
tj|dd!ŒddƒqeWdS(Niÿÿÿÿsutf-8treplaceiit
stackleveli(RR(RR%t
warning_countRt
show_warningsR	RR/tunicodeR0twarningstwarnRtWarning(Rtwstwtmsg((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR$Us		"

cC@st|jdƒS(N(RWRfR	(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt__iter__esN((,t__name__t
__module__t__doc__RMRRwRRRRRRRR!R"R*RR	R,R>R@RCRSRLReRfRjRkRrRAR'R$RƒRRtErrortInterfaceErrort
DatabaseErrort	DataErrortOperationalErrortIntegrityErrort
InternalErrorRtNotSupportedError(((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRsN		
											$)		
	
													tDictCursorMixincB@s eZeZd„Zd„ZRS(cC@s¹tt|ƒjƒg}|jr{xJ|jjD]<}|j}||kr^|jd|}n|j|ƒq/W||_	n|rµ|j
rµg|j
D]}|j|ƒ^q”|_
ndS(Nt.(tsuperRR'R
Rtfieldstnamet
table_nametappendt_fieldsRR(RR’tfR“Rq((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR'xs		cC@s)|dkrdS|jt|j|ƒƒS(N(R	t	dict_typetzipR–(RR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR†s(R„R…R;R˜R'R(((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRts	t
DictCursorcB@seZdZRS(s.A cursor which returns results as a dictionary(R„R…R†(((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRšŒstSSCursorcB@s}eZdZeZd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
d
„Zdd„ZRS(sÃ
    Unbuffered Cursor, mainly useful for queries that return a lot of data,
    or for connections to remote servers over a slow network.

    Instead of copying every row of data into a buffer, this will fetch
    rows as needed. The upside of this is the client uses much less memory,
    and rows are returned much faster when traveling over a slow network
    or if the result set is very big.

    There are limitations, though. The MySQL protocol doesn't support
    returning the total number of rows, so the only way to tell how many rows
    there are is to iterate over every row returned. Also, it currently isn't
    possible to scroll backwards, as only the current row is held in memory.
    cC@s|S(N((RR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR¢scC@sr|j}|dkrdS|jdk	rJ|j|jkrJ|jjƒnzx|jƒr_qPWWdd|_XdS(N(RR	Rt_finish_unbuffered_queryR(RR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR¥s	!cC@s9|jƒ}||_|j|dtƒ|jƒ|jS(NR#(RRsR?R(R'R(RRcR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRA³s
	
cC@s|jdtƒS(NR#(R*R((R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRºscC@s|j|jjƒƒS(s
Read next row(RRt_read_rowdata_packet_unbuffered(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt	read_next½scC@sC|jƒ|jƒ}|dkr0|jƒdS|jd7_|S(sFetch next rowiN(RRžR	R$R(RR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRfÁs

cC@st|jƒƒS(sÈ
        Fetch all, as per MySQLdb. Pretty useless for large queries, as
        it is buffered. See fetchall_unbuffered(), if you want an unbuffered
        generator version of this method.
        (R2tfetchall_unbuffered(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRkËscC@st|jdƒS(sÛ
        Fetch all, implemented as a generator, which isn't to standard,
        however, it doesn't make sense to return everything in a list, as that
        would use ridiculous memory for large result sets.
        N(RWRfR	(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRŸÓscC@s
|jƒS(N(RŸ(R((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRƒÛscC@s…|jƒ|dkr"|j}ng}xVt|ƒD]H}|jƒ}|dkra|jƒPn|j|ƒ|jd7_q5W|S(s
Fetch manyiN(RR	R
RRžR$R•R(RRhR^RdR((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRjÞs


RlcC@så|jƒ|dkrg|dkr4tjdƒ‚nxt|ƒD]}|jƒqAW|j|7_nz|dkrÎ||jkr”tjdƒ‚n||j}xt|ƒD]}|jƒq®W||_ntjd|ƒ‚dS(NRlis0Backwards scrolling not supported by this cursorRmsunknown scroll mode %s(RRRŽRRžRR(RRoRpt_Ri((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyRrîs"

N(R„R…R†R(RwRRRARRžRfRkRŸRƒR	RjRr(((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR›s						
			tSSDictCursorcB@seZdZRS(s;An unbuffered cursor, which returns results as a dictionary(R„R…R†(((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyR¡s(t
__future__RRt	functoolsRtreR}t_compatRRRRDRtcompilet
IGNORECASEtDOTALLRGtobjectRRRšR›R¡(((sD/home/tvault/.virtenv/lib/python2.7/site-packages/pymysql/cursors.pyt<module>sÿ`v