ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 6Rc@sdZddlZddlZy ddlmZmZmZWn#ek rceZe Ze ZnXdZ ej e ej ejBejBZddlmZmZmZmZmZmZmZmZmZmZdefdYZdefd YZd efd YZd efd YZ defdYZ!de!fdYZ"dee efdYZ#dee!efdYZ$dee efdYZ%dee!efdYZ&dS(szMySQLdb Cursors This module implements Cursors of various types for MySQLdb. By default, MySQLdb uses the Cursor class. iN(tListTypet TupleTypet UnicodeTypes \s values \s* ( \( [^()']* (?: (?: (?:\( # ( - editor hightlighting helper .* \)) | ' [^\\']* (?:\\.[^\\']*)* ' ) [^()']* )* \) ) ( tWarningtErrortInterfaceErrort DataErrort DatabaseErrortOperationalErrortIntegrityErrort InternalErrortNotSupportedErrortProgrammingErrort BaseCursorcBsGeZdZddlmZmZmZmZmZm Z m Z m Z m Z m Z mZeZdZdZdZdZdZdZd Zd Zd Zd Zd ZddZdZddZdZ dZ!ddZ"dZ#eZeZeZeZe Z e Z e Z e Z e Z eZRS(sA base for Cursor classes. Useful attributes: description A tuple of DB API 7-tuples describing the columns in the last executed query; see PEP-249 for details. description_flags Tuple of column flags for last query, one entry per column in the result set. Values correspond to those in MySQLdb.constants.FLAG. See MySQL documentation (C API) for more information. Non-standard extension. arraysize default number of rows fetchmany() will fetch i( t MySQLErrorRRRRRRR R R R cCsddlm}|||_d|_d|_d|_d|_d|_d|_ g|_ |j |_ d|_ d|_ d|_d|_dS(Ni(tproxyii(tweakrefRt connectiontNonet descriptiontdescription_flagstrowcountt arraysizet _executedt lastrowidtmessagest errorhandlert_resultt _warningst_infot rownumber(tselfRR((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt__init__Ks           cCs |jd|_d|_dS(N(tcloseRRR(R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt__del__\s  cCs-|js dSx|jrqWd|_dS(s6Close the cursor. No further queries will be possible.N(RtnextsetR(R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR!as  cCs#|js|j|tdndS(Nsexecute() first(RRR (R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt_check_executedgs cCsddlm}|jr|jj}|rx'|D]}|jj|j|fq8Wxf|D]}||d|jdqbWq|jr|jj|j|jf||j|jdqndS(Ni(twarni( twarningsR%Rt_get_dbt show_warningsRtappendRR(RR%R&tw((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt_warning_checkks    cCsg|jr|jn|j2|j}|j}|dkrEdS|j|j|jdS(s`Advance to the next result set. Returns None if there are no more result sets. iiN( RtfetchallRR't next_resultRt_do_get_resultt_post_get_resultR+(Rtdbtnr((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR#zs        cCsdS(N((R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR/tcCs|j}|j|_|j|_d|_|jrK|jjpNd|_|jrl|jj pod|_ |j |_ |j |_|j|_dS(Ni(R't _get_resultRt affected_rowsRRtdescribeRRt field_flagsRt insert_idRt warning_countRtinfoR(RR0((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR.s  !!cGsdS(s!Does nothing, required by DB API.N((Rtargs((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt setinputsizesR2cGsdS(s!Does nothing, required by DB API.N((RR:((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pytsetoutputsizesR2cCs&|js|j|tdn|jS(Ns cursor closed(RRR (R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR's c s|j2|jt|tr:|jjj}n|dk rt|tr~|tfd|j D}q|t g|D]}j |^q}nyd}|j |}Wnt k rQ}|jddkr%|jjt|jdf|j|t|jdq|jjt |f|j|t |nattfk rjnHtj\}}}~|jj||f|j|||nX||_|js|jn|S(sExecute a query. query -- string, query to execute on server args -- optional sequence or mapping, parameters to use with query. Note: If args is a sequence, then %s must be used as the parameter placeholder in the query. If a mapping is used, %(key)s must be used as the placeholder. Returns long integer rows affected, if any c3s*|] \}}|j|fVqdS(N(tliteral(t.0tkeytitem(R0(sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pys sis&not enough arguments for format stringsnot all arguments convertedN(s&not enough arguments for format stringsnot all arguments converted(RR't isinstancetunicodetencodetunicode_literaltcharsetRtdictt iteritemsttupleR=t_queryt TypeErrorR:R)R Rt SystemExittKeyboardInterrupttsystexc_infoRt_defer_warningsR+( RtqueryR:R@trtmtexctvaluettb((R0sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pytexecutes<  /    cs3|j2|j|sdSt|trD|jjj}ntj|}|sd}x$|D]}||j ||}qfW|S|j d}|j d}|j d}yg} x|D]x}t|t r | j|t fd|jDq| j|tg|D]} j| ^qqWWntk r} | jdd kr|j|t| jdq|j|t| nKttfk rn2tj\} } }~|j|| | nX|jdj|| dj| ||g}|js/|jn|S( sExecute a multi-row query. query -- string, query to execute on server args Sequence of sequences or mappings, parameters to use with query. Returns long integer rows affected, if any. This method improves performance on multiple-row INSERT and REPLACE. Otherwise it is equivalent to looping over args with execute(). Niic3s*|] \}}|j|fVqdS(N(R=(R>R?R@(R0(sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pys ss&not enough arguments for format stringsnot all arguments converteds s, (s&not enough arguments for format stringsnot all arguments converted(RR'RARBRCRDREt insert_valuestsearchRVtstarttendtgroupRFR)RGRHR=RJR:RR RKRLRMRNRItjoinROR+(RRPR:RRRQtatptetqvtqR@tmsgRSRTRU((R0sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt executemanysJ   ;  2 cCs|j}xtt|D]f\}}d|||j|f}t|trh|j|jj}n|j||j qWd|dj gt t |D]}d||f^qf}t |tkr|j|jj}n|j|||_|js|jn|S(s'Execute 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=%ss CALL %s(%s)t,s@_%s_%d(R't enumerateR=RARBRCRDRERIR#R\trangetlenttypeRRROR+(RtprocnameR:R0tindextargRati((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pytcallproc s$    3   cCs3|j}||_|j||j|jS(N(R't_last_executedRPR.R(RRaR0((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt _do_query;s     cCs |j|S(N(Ro(RRa((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRIBR2icCs#|js dS|jj||jS(N((Rt fetch_rowt _fetch_type(Rtsize((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt _fetch_rowDs cCst|jdS(N(titertfetchoneR(R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt__iter__IsN(($t__name__t __module__t__doc__t_mysql_exceptionsRRRRRRRR R R R tFalseROR R"R!R$R+R#R/R.R;R<R'RRVRcRmRoRIRsRv(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR 2s>L           . 8 1    tCursorStoreResultMixIncBs\eZdZdZdZdZdZd dZdZ ddZ d Z RS( sThis is a MixIn class which causes the entire result set to be stored on the client side, i.e. it uses mysql_store_result(). If the result set can be very large, consider adding a LIMIT clause to your query, or using CursorUseResultMixIn instead.cCs|jjS(N(R't store_result(R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR3_R2cCs|j|}|j|S(N(RoR/(RRaR((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRIas cCs|jd|_d|_dS(Ni(Rst_rowsRR(R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR/fscCsJ|j|jt|jkr&dS|j|j}|jd|_|S(s]Fetches a single row from the cursor. None indicates that no more rows are available.iN(R$RRgR~R(Rtresult((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRujs  cCsR|j|j|p|j}|j|j|!}t|t|j|_|S(sFetch up to size rows from the cursor. Result set may be smaller than size. If size is not defined, cursor.arraysize is used.(R$RRR~tminRg(RRrRZR((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt fetchmanyss  cCsE|j|jr&|j|j}n |j}t|j|_|S(s*Fetchs all available rows from the cursor.(R$RR~Rg(RR((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR,|s    trelativecCs|j|dkr&|j|}n2|dkr;|}n|j|tdt||dksy|t|jkr|j|tdn||_dS(sScroll the cursor in the result set to a new position according to mode. If mode is 'relative' (default), value is taken as offset to the current position in the result set, if set to 'absolute', value states an absolute target position.Rtabsolutesunknown scroll mode %sis out of rangeN(R$RRR treprRgR~t IndexError(RRTtmodeRQ((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pytscrolls     !cCs6|j|jr#|j|jp)|j}t|S(N(R$RR~Rt(RR((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRvs "N( RwRxRyR3RIR/RuRRR,RRv(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR|Xs    tCursorUseResultMixIncBsMeZdZeZdZdZddZdZ dZ dZ RS(sThis is a MixIn class which causes the result set to be stored in the server and sent row-by-row to client side, i.e. it uses mysql_use_result(). You MUST retrieve the entire result set and close() the cursor before additional queries can be peformed on the connection.cCs|jjS(N(R't use_result(R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR3R2cCsE|j|jd}|s-|jdS|jd|_|dS(s%Fetches a single row from the cursor.iiN(R$RsR+RR(RRQ((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRus  cCsO|j|j|p|j}|jt||_|sK|jn|S(sFetch up to size rows from the cursor. Result set may be smaller than size. If size is not defined, cursor.arraysize is used.(R$RsRRRgR+(RRrRQ((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRs   cCs=|j|jd}|jt||_|j|S(s*Fetchs all available rows from the cursor.i(R$RsRRgR+(RRQ((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR,s   cCs|S(N((R((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRvscCs%|j}|dkr!tn|S(N(RuRt StopIteration(Rtrow((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pytnexts   N( RwRxRytTrueROR3RuRRR,RvR(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRs   tCursorTupleRowsMixIncBseZdZdZRS(swThis is a MixIn class that causes all rows to be returned as tuples, which is the standard form required by DB API.i(RwRxRyRq(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRstCursorDictRowsMixIncBs2eZdZdZdZddZdZRS(snThis is a MixIn class that causes all rows to be returned as dictionaries. This is a non-standard feature.icCs*ddlm}|dtd|jS(sgFetch a single row as a dictionary. Deprecated: Use fetchone() instead. Will be removed in 1.3.i(R%s9fetchoneDict() is non-standard and will be removed in 1.3i(R&R%tDeprecationWarningRu(RR%((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt fetchoneDicts cCs-ddlm}|dtd|j|S(srFetch several rows as a list of dictionaries. Deprecated: Use fetchmany() instead. Will be removed in 1.3.i(R%s:fetchmanyDict() is non-standard and will be removed in 1.3i(R&R%RR(RRrR%((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt fetchmanyDicts cCs*ddlm}|dtd|jS(swFetch all available rows as a list of dictionaries. Deprecated: Use fetchall() instead. Will be removed in 1.3.i(R%s9fetchallDict() is non-standard and will be removed in 1.3i(R&R%RR,(RR%((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyt fetchallDicts N(RwRxRyRqRRRR(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRs   tCursorOldDictRowsMixIncBseZdZdZRS(sThis is a MixIn class that returns rows as dictionaries with the same key convention as the old Mysqldb (MySQLmodule). Don't use this.i(RwRxRyRq(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRstCursorcBseZdZRS(sjThis is the standard Cursor class that returns rows as tuples and stores the result set in the client.(RwRxRy(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRst DictCursorcBseZdZRS(seThis is a Cursor class that returns rows as dictionaries and stores the result set in the client.(RwRxRy(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyR stSSCursorcBseZdZRS(s_This is a Cursor class that returns rows as tuples and stores the result set in the server.(RwRxRy(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRst SSDictCursorcBseZdZRS(seThis is a Cursor class that returns rows as dictionaries and stores the result set in the server.(RwRxRy(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyRs('RytreRMttypesRRRt ImportErrortlistRHtstrtrestrtcompiletStItXRWRzRRRRRRR R R R tobjectR R|RRRRRRRR(((sB/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/cursors.pyts4     #F'G2