Corrected PEP8 behavior, thanks Sergey
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -23,6 +23,7 @@ Linden Lab Contributors
|
||||
|
||||
Thanks To
|
||||
---------
|
||||
* Sergey Shepelev, PEP 8 police :-)
|
||||
* Luci Stanescu, for reporting twisted hub bug
|
||||
* Marcus Cavanaugh, for test case code that has been incredibly useful in tracking down bugs
|
||||
* Brian Brunswick, for many helpful questions and suggestions on the mailing list
|
||||
|
||||
@@ -245,7 +245,8 @@ class SaranwrappedConnectionPool(BaseConnectionPool):
|
||||
*self._args,
|
||||
**self._kwargs)
|
||||
|
||||
def connect(self, db_module, connect_timeout, *args, **kw):
|
||||
@classmethod
|
||||
def connect(cls, db_module, connect_timeout, *args, **kw):
|
||||
timeout = api.exc_after(connect_timeout, ConnectTimeout())
|
||||
try:
|
||||
from eventlet import saranwrap
|
||||
@@ -253,8 +254,6 @@ class SaranwrappedConnectionPool(BaseConnectionPool):
|
||||
finally:
|
||||
timeout.cancel()
|
||||
|
||||
connect = classmethod(connect)
|
||||
|
||||
|
||||
class TpooledConnectionPool(BaseConnectionPool):
|
||||
"""A pool which gives out :class:`~eventlet.tpool.Proxy`-based database
|
||||
@@ -266,7 +265,8 @@ class TpooledConnectionPool(BaseConnectionPool):
|
||||
*self._args,
|
||||
**self._kwargs)
|
||||
|
||||
def connect(self, db_module, connect_timeout, *args, **kw):
|
||||
@classmethod
|
||||
def connect(cls, db_module, connect_timeout, *args, **kw):
|
||||
timeout = api.exc_after(connect_timeout, ConnectTimeout())
|
||||
try:
|
||||
from eventlet import tpool
|
||||
@@ -280,8 +280,6 @@ class TpooledConnectionPool(BaseConnectionPool):
|
||||
finally:
|
||||
timeout.cancel()
|
||||
|
||||
connect = classmethod(connect)
|
||||
|
||||
|
||||
class RawConnectionPool(BaseConnectionPool):
|
||||
"""A pool which gives out plain database connections.
|
||||
@@ -292,15 +290,14 @@ class RawConnectionPool(BaseConnectionPool):
|
||||
*self._args,
|
||||
**self._kwargs)
|
||||
|
||||
def connect(self, db_module, connect_timeout, *args, **kw):
|
||||
@classmethod
|
||||
def connect(cls, db_module, connect_timeout, *args, **kw):
|
||||
timeout = api.exc_after(connect_timeout, ConnectTimeout())
|
||||
try:
|
||||
return db_module.connect(*args, **kw)
|
||||
finally:
|
||||
timeout.cancel()
|
||||
|
||||
connect = classmethod(connect)
|
||||
|
||||
|
||||
# default connection pool is the tpool one
|
||||
ConnectionPool = TpooledConnectionPool
|
||||
|
||||
Reference in New Issue
Block a user