Current Path : /usr/lib/python2.7/dist-packages/twisted/enterprise/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyc |
[XMc @ s d Z d d l Z d d l m Z d d l m Z m Z d d l m Z d d l m Z d e f d YZ d e f d YZ d f d YZ d f d YZ e d d d d Z e e Z d Z d Z e e Z d d d g Z d S( sg An asynchronous mapping to U{DB-API 2.0<http://www.python.org/topics/database/DatabaseAPI-2.0.html>}. iN( t threads( t reflectt log( t deprecated( t Versiont ConnectionLostc B s e Z d Z RS( sb This exception means that a db connection has been lost. Client code may try again. ( t __name__t __module__t __doc__( ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR s t Connectionc B s; e Z d Z d Z d Z d Z d Z d Z RS( s A wrapper for a DB-API connection instance. The wrapper passes almost everything to the wrapped connection and so has the same API. However, the Connection knows about its pool and also handle reconnecting should when the real connection dies. c C s | | _ d | _ | j d S( N( t _poolt Nonet _connectiont reconnect( t selft pool( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyt __init__# s c C s d S( N( ( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyt close( s c C s | j j s | j j d SyN | j j | j j } | j | j j | j | j j d SWn t j d d n X| j j | j | j j r t j d n t d S( Ns Rollback faileds Connection lost.( R R R t rollbackt cursort executet good_sqlR t commitR t errR t disconnectt noisyt msgR ( R t curs( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR 2 s c C s; | j d k r% | j j | j n | j j | _ d S( N( R R R R t connect( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR H s c C s t | j | S( N( t getattrR ( R t name( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyt __getattr__M s ( R R R R R R R R ( ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR s t Transactionc B sA e Z d Z d Z d Z d Z d Z d Z d Z RS( s A lightweight wrapper for a DB-API 'cursor' object. Relays attribute access to the DB cursor. That is, you can call execute(), fetchall(), etc., and they will be called on the underlying DB-API cursor object. Attributes will also be retrieved from there. c C s | | _ | | _ | j d S( N( R R t reopen( R R t connection( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR [ s c C s | j } d | _ | j d S( N( t _cursorR R ( R R# ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR ` s c C s | j d k r | j n y | j j | _ d SWn) | j j sN qb t j d d n X| j j r~ t j d n | j | j j | _ d S( Ns Cursor creation faileds Connection lost, reconnecting( R# R R R R R R R R R R ( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR! e s c C s | j j d | _ d S( N( R R R R# ( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR x s c C s t | j | S( N( R R# ( R R ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR | s N( R R R R R# R R R! R R ( ( ( s= /usr/lib/python2.7/dist-packages/twisted/enterprise/adbapi.pyR Q s t ConnectionPoolc B s e Z d Z d j Z e Z d Z d Z d Z d Z e Z d Z e Z e Z e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z! d Z"