fsl.utils.platform¶
This module provides the Platform class, which is a container
of information about the current platform we are running on. A single
Platform instance is created when this module is first imported, and
is available as a module attribute called platform.
-
fsl.utils.platform.WX_UNKNOWN= 0¶ Identifier for the
Platform.wxFlavourandPlatform.wxPlatformproperties indicating an unknown/undetermined flavour/platform.
-
fsl.utils.platform.WX_PYTHON= 1¶ Identifier for the
Platform.wxFlavourproperty, indicating that we are running standard wx Python.
-
fsl.utils.platform.WX_PHOENIX= 2¶ Identifier for the
Platform.wxFlavourproperty, indicating that we are running wx Python/Phoenix.
-
fsl.utils.platform.WX_MAC_COCOA= 1¶ Identifier for the
Platform.wxPlatformproperty, indicating that we are running the OSX cocoa wx build.
-
fsl.utils.platform.WX_MAC_CARBON= 2¶ Identifier for the
Platform.wxPlatformproperty, indicating that we are running the OSX carbon wx build.
-
fsl.utils.platform.WX_GTK= 3¶ Identifier for the
Platform.wxPlatformproperty, indicating that we are running the Linux/GTK wx build.
-
class
fsl.utils.platform.Platform[source]¶ Bases:
fsl.utils.notifier.NotifierThe
Platformclass contains a handful of properties which contain information about the platform we are running on.Note
The values of the
glVersionandglRendererproperties are not automatically set - they will only contain a value if one is assigned to them. FSLeyes does this during startup, in thefsleyes.gl.bootstrap()function.osThe operating system name. frozenTrueif we are running in a compiled/frozen application,Falseotherwise.fsldirThe FSL installation location. fsldevdirThe FSL development directory location. haveGuiTrueif we are running with a GUI,Falseotherwise.canHaveGuiTrueif it is possible to create a GUI,Falseotherwise.inSSHSessionTrueif this application is running over an SSH session,Falseotherwise.wxPlatformOne of WX_UNKNOWN,WX_MAC_COCOA,WX_MAC_CARBON, orWX_GTK, indicating the wx platform.wxFlavourOne of WX_UNKNOWN,WX_PYTHONorWX_PHOENIX, indicating the wx flavour.glVersionReturns the available OpenGL version, or Noneif it has not been set.glRendererReturns the available OpenGL renderer, or Noneif it has not been set.glIsSoftwareRendererReturns Trueif the OpenGL renderer is software based,Falseotherwise, orNoneif the renderer has not yet been set.-
os¶ The operating system name. Whatever is returned by the built-in
platform.systemfunction.
-
frozen¶ Trueif we are running in a compiled/frozen application,Falseotherwise.
-
haveGui¶ 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.
-
canHaveGui¶ Trueif it is possible to create a GUI,Falseotherwise.
-
inSSHSession¶ Trueif this application is running over an SSH session,Falseotherwise.
-
__module__= 'fsl.utils.platform'¶
-
inVNCSession¶ Trueif this application is running over a VNC (or similar) session,Falseotherwise. Currently, the following remote desktop environments are detected:- VNC
- x2go
- NoMachine
-
wxPlatform¶ One of
WX_UNKNOWN,WX_MAC_COCOA,WX_MAC_CARBON, orWX_GTK, indicating the wx platform.
-
wxFlavour¶ One of
WX_UNKNOWN,WX_PYTHONorWX_PHOENIX, indicating the wx flavour.
-
fsldir¶ The FSL installation location.
Note
The
fsldirproperty can be updated - when it is changed, any registered listeners are notified via theNotifierinterface.
-
fsldevdir¶ The FSL development directory location.
-
fslVersion¶ Returns the FSL version as a string, e.g.
'5.0.9'. ReturnsNoneif a FSL installation could not be found.
-
glVersion¶ Returns the available OpenGL version, or
Noneif it has not been set.
-
glRenderer¶ Returns the available OpenGL renderer, or
Noneif it has not been set.
-
glIsSoftwareRenderer¶ Returns
Trueif the OpenGL renderer is software based,Falseotherwise, orNoneif the renderer has not yet been set.Note
This check is based on heuristics, ans is not guaranteed to be correct.
-
-
fsl.utils.platform.platform= <fsl.utils.platform.Platform object>¶ An instance of the
Platformclass. Feel free to create your own instance, but be aware that if you do so you will not be updated of changes to thePlatform.fsldirproperty.