ok

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyo

�
�6�Rc@s�dZddlmZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
ddlZddlZddlZd�Zejd�Zd�Zdejfd	��YZdS(
s

This module implements connections for MySQLdb. Presently there is
only one class: Connection. Others are unlikely. However, you might
want to make your own subclasses. In most cases, you will probably
override Connection.default_cursor with a non-standard Cursor class.

i����(tcursors(
tWarningtErrortInterfaceErrort	DataErrort
DatabaseErrortOperationalErrortIntegrityErrort
InternalErrortNotSupportedErrortProgrammingErrorNcCsH||f}|r%|jj|�n|jj|�~~||�dS(s,

    If cursor is not None, (errorclass, errorvalue) is appended to
    cursor.messages; otherwise it is appended to
    connection.messages. Then errorclass is raised with errorvalue as
    the value.

    You can override this with your own error handler by assigning it
    to the instance.

    N(tmessagestappend(t
connectiontcursort
errorclasst
errorvalueterror((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pytdefaulterrorhandlerss^(\d+)cCs,tj|�}|r(t|jd��SdS(s�Returns the leading numeric part of a string.

    >>> numeric_part("20-alpha")
    20
    >>> numeric_part("foo")
    >>> numeric_part("16b")
    16
    iN(tre_numeric_parttmatchtinttgrouptNone(tstm((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pytnumeric_part(s
t
ConnectioncBs�eZdZejZd�Zd�Zd
d�Z	d�Z
d�Zd�Zd�Z
eejd�sud	�Znd
�Zd�Zd�ZeZeZeZeZeZeZeZeZeZeZeZ RS(s MySQL Database Connection Objectcs�ddlm}m}ddlm}ddlm}|j�}d|kr[|d}n|}i}	xP|j�D]B\}
}t	|
t
�r�t	|t�r�||	|
<qt||	|
<qtW|	|d<|jd|j
�}|jdd�}
|
r�t}nt}|jd	|�}|jd
d�}|jdd�}tgtj�jd
�d D]}t|�^qS�}|dkr�||jO}n|dkr�||jO}n||d<|jdt�}tt|�j||�||_tg|j�D]*\}
}t|
�t
k	r�|
|f^q��|_tg|j�jd
�d D]}t|�^qG�|_ ||���fd�}�fd�}d�}|�}|�|_!}|�|_"}|
s�|j#�}
n|j$|
�|r�|j%|�n|rv|j&|j'j(d|f�|j&|j*j(d|f�|j&|j+j(d|f�|j&|j,j(d|f�n||jt-j.<||jt-j/<|j0|j1@|_2|j2r�|dk	r�|j3|�q�ng|_4dS(s�


        Create a connection to the database. It is strongly recommended
        that you only use keyword parameters. Consult the MySQL C API
        documentation for more information.

        host
          string, host to connect

        user
          string, user to connect as

        passwd
          string, password to use

        db
          string, database to use

        port
          integer, TCP/IP port to connect to

        unix_socket
          string, location of unix_socket to use

        conv
          conversion dictionary, see MySQLdb.converters

        connect_timeout
          number of seconds to wait before the connection attempt
          fails.

        compress
          if set, compression is enabled

        named_pipe
          if set, a named pipe is used to connect (Windows only)

        init_command
          command which is run once the connection is created

        read_default_file
          file from which default client values are read

        read_default_group
          configuration group to use from the default file

        cursorclass
          class object, used to create cursors (keyword only)

        use_unicode
          If True, text-like columns are returned as unicode objects
          using the connection's character set.  Otherwise, text-like
          columns are returned as strings.  columns are returned as
          normal strings. Unicode objects will always be encoded to
          the connection's character set regardless of this setting.

        charset
          If supplied, the connection character set will be changed
          to this character set (MySQL-4.1 and newer). This implies
          use_unicode=True.

        sql_mode
          If supplied, the session SQL mode will be changed to this
          setting (MySQL-4.1 and newer). For more details and legal
          values, see the MySQL documentation.

        client_flag
          integer, flags to use or 0
          (see MySQL docs or constants/CLIENTS.py)

        ssl
          dictionary or mapping, contains SSL connection parameters;
          see the MySQL documentation for more details
          (mysql_ssl_set()).  If this is set, and the client does not
          support SSL, NotSupportedError will be raised.

        local_infile
          integer, non-zero enables LOAD LOCAL INFILE; zero disables

        autocommit
          If False (default), autocommit is disabled.
          If True, autocommit is enabled.
          If None, autocommit isn't set and server default is used.

        There are a number of undocumented, non-standard methods. See the
        documentation for the MySQL C API for some hints on what they do.

        i����(tCLIENTt
FIELD_TYPE(tconversions(tproxytconvtcursorclasstcharsetttuse_unicodetsql_modetclient_flagit.iiiit
autocommitcsd�fd�}|S(Ncs
�j|�S(N(tstring_literal(tobjtdummy(tdb(sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR)�s(R(R)(R,(sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt_get_string_literal�scsd��fd���S(Ncs�j|j�j��S(N(tliteraltencodeR"(tuR+(R,tunicode_literal(sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR1�s(R((R,(R1sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt_get_unicode_literal�scs�fd���S(Ncs|j�j�S(N(tdecodeR"(R(tstring_decoder(sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR4�s((((R4sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt_get_string_decoder�sN(ii(ii(5tMySQLdb.constantsRRtMySQLdb.convertersRtweakrefRtcopytitemst
isinstanceRtlisttpoptdefault_cursortTruetFalsetgetttuplet_mysqltget_client_infotsplitRtMULTI_STATEMENTSt
MULTI_RESULTStsuperRt__init__R!tdictttypetencoderstget_server_infot_server_versionR1R4tcharacter_set_nametset_character_settset_sql_modet	convertertSTRINGRRt
VAR_STRINGtVARCHARtBLOBttypest
StringTypetUnicodeTypetserver_capabilitiestTRANSACTIONSt_transactionalR(R(tselftargstkwargsRRRRtkwargs2R tconv2tktvR!R"R$R%R&tntclient_versionR(R-R2R5R)R1R4((R,sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyRI>srY

	8
	*;		
 	cCs8t|�}|j�|kr4tjj||�ndS(N(tbooltget_autocommitRCR
R((R]ton((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR(�scCs|p|j|�S(s�

        Create a cursor on which queries may be performed. The
        optional cursorclass parameter is used to create the
        Cursor. By default, self.cursorclass=cursors.Cursor is
        used.

        (R!(R]R!((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR�s	cCs&|j�r|jd�n|j�S(NtBEGIN(RgtqueryR(R]((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt	__enter__scCs!|r|j�n
|j�dS(N(trollbacktcommit(R]texctvaluettb((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt__exit__s
cCs|j||j�S(s

        If o is a single object, returns an SQL literal as a string.
        If o is a non-string sequence, the items of the sequence are
        converted and returned as a sequence.

        Non-standard. For internal use; do not use this in your
        applications.

        (tescapeRL(R]to((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR.scCs1ddlm}|dtd�|jd�dS(s�Explicitly begin a connection. Non-standard.
        DEPRECATED: Will be removed in 1.3.
        Use an SQL BEGIN statement instead.i����(twarns2begin() is non-standard and will be removed in 1.3iRiN(twarningsRttDeprecationWarningRj(R]Rt((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pytbegins
t
warning_countcCs>ddlm}|j�}|r6||j�d�SdSdS(spReturn the number of warnings generated from the
            last query. This is derived from the info() method.i����(tatoiiN(tstringRytinfoRE(R]RyR{((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyRx#s
cCs�|dkrd}n|}|j�|kr�ytt|�j|�Wq�tk
r�|jdkrutd��n|jd|�|j�q�Xn||j	_
||j_
dS(	s�Set the connection character set to charset. The character
        set can only be changed in MySQL-4.1 and newer. If you try
        to change the character set from the current value in an
        older version, NotSupportedError will be raised.tutf8mb4tutf8iis server is too old to set charsetsSET NAMES %sN(ii(RORHRRPtAttributeErrorRNR	Rjtstore_resultR4R"R1(R]R"t
py_charset((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyRP-s	
cCs=|jdkrtd��n|jd|�|j�dS(sNSet the connection sql_mode. See MySQL documentation for
        legal values.iis!server is too old to set sql_modesSET SESSION sql_mode='%s'N(ii(RNR	RjR(R]R%((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyRQAscCs?|jdkrdS|jd�|j�}|jd�}|S(s�Return detailed information about warnings as a
        sequence of tuples of (Level, Code, Message). This
        is only supported in MySQL-4.1 and up. If your server
        is an earlier version, an empty sequence is returned.iis
SHOW WARNINGSi(ii((RNRjRt	fetch_row(R]trRu((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt
show_warningsIs
N(!t__name__t
__module__t__doc__RtCursorR>RIR(RRRkRqR.RwthasattrRCR
RxRPRQR�RRRRRRRRR
R	Rterrorhandler(((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyR8s2		�				
		
			(R�tMySQLdbRt_mysql_exceptionsRRRRRRRRR	R
RWRCtreRtcompileRRR
R(((sF/opt/alt/python27/lib64/python2.7/site-packages/MySQLdb/connections.pyt<module>sF		

Zerion Mini Shell 1.0