X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=eventlet%2Feventlet%2Fgreen%2FMySQLdb.py;fp=eventlet%2Feventlet%2Fgreen%2FMySQLdb.py;h=0000000000000000000000000000000000000000;hb=358bd9258c2b6d2ee74de4dfd07a5123107abad4;hp=3593542db8d3321360fdedf4c56661e8badea7a6;hpb=376ff3bfe7071cc0793184a378c4e74508fb0d97;p=packages%2Ftrusty%2Fpython-eventlet.git diff --git a/eventlet/eventlet/green/MySQLdb.py b/eventlet/eventlet/green/MySQLdb.py deleted file mode 100644 index 3593542..0000000 --- a/eventlet/eventlet/green/MySQLdb.py +++ /dev/null @@ -1,37 +0,0 @@ -__MySQLdb = __import__('MySQLdb') - -__all__ = __MySQLdb.__all__ -__patched__ = ["connect", "Connect", 'Connection', 'connections'] - -from eventlet.patcher import slurp_properties -slurp_properties( - __MySQLdb, globals(), - ignore=__patched__, srckeys=dir(__MySQLdb)) - -from eventlet import tpool - -__orig_connections = __import__('MySQLdb.connections').connections - - -def Connection(*args, **kw): - conn = tpool.execute(__orig_connections.Connection, *args, **kw) - return tpool.Proxy(conn, autowrap_names=('cursor',)) -connect = Connect = Connection - - -# replicate the MySQLdb.connections module but with a tpooled Connection factory -class MySQLdbConnectionsModule(object): - pass - -connections = MySQLdbConnectionsModule() -for var in dir(__orig_connections): - if not var.startswith('__'): - setattr(connections, var, getattr(__orig_connections, var)) -connections.Connection = Connection - -cursors = __import__('MySQLdb.cursors').cursors -converters = __import__('MySQLdb.converters').converters - -# TODO support instantiating cursors.FooCursor objects directly -# TODO though this is a low priority, it would be nice if we supported -# subclassing eventlet.green.MySQLdb.connections.Connection