This module adds a fix for wx.py’s introspect module.
In order to do code-completion, the function introspect.getAttributeName accesses all the attributes of the current object. This causes severe problems for modules like tvtk which depend on lazy importing. The original introspect module also has severe problems with large Numeric arrays because it calls str() on the Numeric object in order to find its methods.
This file defines a fixed function that works fine with lazy objects and large Numeric arrays. This fixed function is injected into the introspect module.
Return dict of all attributes, including inherited, for an object.
Recursively walk through a class and all base classes.
Return list of unique attributes, including inherited, for object.
Utility functions for working with wx Fonts.
Creates a new font, like another one, only different. Maybe.
Support for creating GUI apps and starting event loops.
IPython’s GUI integration allows interative plotting and GUI usage in IPython session. IPython has two different types of GUI integration:
In addition to starting the GUI event loops in one of these two ways, IPython will always create an appropriate GUI application object when GUi integration is enabled.
If you want your GUI apps to run in IPython you need to do two things:
This module contains functions for each toolkit that perform these things in a consistent manner. Because of how PyOS_InputHook runs the event loop you cannot detect if the event loop is running using the traditional calls (such as wx.GetApp.IsMainLoopRunning() in wxPython). If PyOS_InputHook is set These methods will return a false negative. That is, they will say the event loop is not running, when is actually is. To work around this limitation we proposed the following informal protocol:
The functions below implement this logic for each GUI toolkit. If you need to create custom application subclasses, you will likely have to modify this code for your own purposes. This code can be copied into your own project so you don’t have to depend on IPython.
Create a new qt4 app or return an existing one.
Create a new wx app or return an exiting one.
Is the qt4 event loop running.
Is the wx event loop running.
Start the qt4 event loop in a consistent manner.
Start the wx event loop in a consistent manner.