fsleyes_widgets.utils
This package contains a collection of small utility modules for doing random things. A few functions are also defined at the package level:
Return a string containing the "major.minor.patch" version of wxPython that is installed, or |
|
Determines the version of wxPython being used. |
|
Returns one of |
|
|
|
Return |
|
|
|
Return |
|
Returns |
|
Returns |
This package can be imported, and all of its functions called (with the
exception of isalive()), without wx being installed.
- fsleyes_widgets.utils.WX_PYTHON = 1
Constant returned by the
wxFlavour()function, indicating that wxPython 3.0.2.0 or older is being used.
- fsleyes_widgets.utils.WX_PHOENIX = 2
Constant returned by the
wxFlavour()function, indicating that wxPython/Phoenix (>= 3.0.3) is being used.
- fsleyes_widgets.utils.WX_UNKNOWN = 0
Constant returned by the
wxPlatform()function, indicating that an unknown wx version is being used.
- fsleyes_widgets.utils.WX_MAC_COCOA = 1
Constant returned by the
wxPlatform()function, indicating that an OSX cocoa wx version is being used.
- fsleyes_widgets.utils.WX_MAC_CARBON = 2
Constant returned by the
wxPlatform()function, indicating that an OSX carbon wx version is being used.
- fsleyes_widgets.utils.WX_GTK = 3
Alias for
WX_GTK2- will be removed in a future version offsleyes-widgets.
- fsleyes_widgets.utils.WX_GTK2 = 3
Constant returned by the
wxPlatform()function, indicating that a Linux/GTK3 wx version is being used.
- fsleyes_widgets.utils.WX_GTK3 = 4
Constant returned by the
wxPlatform()function, indicating that a Linux/GTK3 wx version is being used.
- fsleyes_widgets.utils.wxVersion()[source]
Return a string containing the “major.minor.patch” version of wxPython that is installed, or
Noneif wxPython is not installed, or its version cannot be determined.
- fsleyes_widgets.utils.wxFlavour()[source]
Determines the version of wxPython being used. Returns
WX_PYTHON,WX_PHOENIX,or ``Noneif wxPython does not appear to be installed.
- fsleyes_widgets.utils.wxPlatform()[source]
Returns one of
WX_UNKNOWNWX_MAC_COCOA,WX_MAC_CARBON,WX_GTK2, orWX_GTK3, indicating the wx platform, orNoneif wxPython does not appear to be installed.
- fsleyes_widgets.utils.frozen()[source]
Trueif we are running in a compiled/frozen application (e.g. pyinstaller, py2app),Falseotherwise.
- fsleyes_widgets.utils.haveGui()[source]
Trueif we are running with a GUI,Falseotherwise.This currently equates to testing whether a display is available (see
canHaveGui()) and whether awx.Appexists. It previously also tested whether an event loop was running, but this is not compatible with execution from IPython/Jupyter notebook, where the event loop is called periodically, and so is not always running.
- fsleyes_widgets.utils.inSSHSession()[source]
Return
Trueif this application appears to be running over an SSH session,Falseotherwise.
- fsleyes_widgets.utils.inVNCSession()[source]
Returns
Trueif this application appears to be running over a VNC (or similar) session,Falseotherwise. Currently, the following remote desktop environments are detected:VNC
x2go
NoMachine
- fsleyes_widgets.utils.isalive(widget)[source]
Returns
Trueif the givenwx.Windowobject is “alive” (i.e. has not been destroyed),Falseotherwise. Works in both wxPython and wxPython/Phoenix.Warning
Don’t try to test whether a
wx.MenuItemhas been destroyed, as it will probably result in segmentation faults. Check the parentwx.Menuinstead.