Skip to content

Commit

Permalink
Add docstrings, remove unnecessary import
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Foster committed Aug 3, 2012
1 parent c1734d8 commit 0c36f73
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion IPython/lib/inputhook.py
Expand Up @@ -459,13 +459,31 @@ def disable_gtk3(self):
self.clear_inputhook()

def enable_gevent(self, app=None):
import gevent
"""Enable event loop integration with gevent.
Parameters
----------
app : ignored
Ignored, it's only a placeholder to keep the call signature of all
gui activation methods consistent, which simplifies the logic of
supporting magics.
Notes
-----
This methods sets the PyOS_InputHook for gevent, which allows
gevent greenlets to run in the background while interactively using
IPython.
"""
from IPython.lib.inputhookgevent import inputhook_gevent
self.set_inputhook(inputhook_gevent)
self._current_gui = GUI_GEVENT
return app

def disable_gevent(self):
"""Disable event loop integration with gevent.
This merely sets PyOS_InputHook to NULL.
"""
self.clear_inputhook()

def current_gui(self):
Expand Down

0 comments on commit 0c36f73

Please sign in to comment.