Corrected PEP8 behavior, thanks Sergey

This commit is contained in:
Ryan Williams
2009-11-04 13:57:34 -08:00
parent 513e3eb5a3
commit 11fa908084
2 changed files with 7 additions and 9 deletions

View File

@@ -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

View File

@@ -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