Deprecated api.py and removed references to it.

This commit is contained in:
Ryan Williams
2010-02-20 14:44:31 -05:00
parent 91015ddf9d
commit 9ab49a41ca
5 changed files with 7 additions and 7 deletions

View File

@@ -17,6 +17,9 @@ __all__ = [
'ssl_listener', 'tcp_listener', 'trampoline',
'unspew', 'use_hub', 'with_timeout', 'timeout']
warnings.warn("eventlet.api is deprecated! Nearly everything in it has moved "
"to the eventlet module.", DeprecationWarning, stacklevel=2)
def get_hub(*a, **kw):
warnings.warn("eventlet.api.get_hub has moved to eventlet.hubs.get_hub",
DeprecationWarning, stacklevel=2)

View File

@@ -1,8 +1,8 @@
from eventlet import api
from eventlet import greenthread
def get_ident():
""" Returns ``id()`` of current greenlet. Useful for debugging."""
return id(api.getcurrent())
return id(greenthread.getcurrent())
# TODO: The base threadlocal class wants to call __init__ on itself for every new thread that associates with it; our corolocal doesn't do this, but should for 100% compatibility. The implementation in _threading_local.py is so janky....
class local(object):

View File

@@ -1,8 +1,6 @@
__select = __import__('select')
error = __select.error
from eventlet.api import getcurrent
from eventlet.greenthread import getcurrent
from eventlet.hubs import get_hub
__patched__ = ['select']

View File

@@ -2,4 +2,4 @@ __time = __import__('time')
for var in dir(__time):
exec "%s = __time.%s" % (var, var)
__patched__ = ['sleep']
from eventlet.api import sleep
from eventlet.greenthread import sleep

View File

@@ -1,6 +1,5 @@
import collections
from eventlet import api
from eventlet import queue
__all__ = ['Pool', 'TokenPool']