Commit 81fbc3c5 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: What's the point in having these functions in this library? They can be

moved into fsleyes
parent 34128320
...@@ -36,7 +36,4 @@ from fsleyes_widgets.utils import (WX_PYTHON, # noqa ...@@ -36,7 +36,4 @@ from fsleyes_widgets.utils import (WX_PYTHON, # noqa
haveGui, haveGui,
inSSHSession, inSSHSession,
inVNCSession, inVNCSession,
glVersion,
glRenderer,
glIsSoftwareRenderer,
isalive) isalive)
...@@ -18,9 +18,6 @@ random things. A few functions are also defined at the package level: ...@@ -18,9 +18,6 @@ random things. A few functions are also defined at the package level:
haveGui haveGui
inSSHSession inSSHSession
inVNCSession inVNCSession
glVersion
glRenderer
glIsSoftwareRenderer
isalive isalive
...@@ -222,56 +219,6 @@ def inVNCSession(): ...@@ -222,56 +219,6 @@ def inVNCSession():
return any(v in os.environ for v in vncVars) return any(v in os.environ for v in vncVars)
def glVersion():
"""Return the OpenGL version.
.. note:: The values of ``glVersion`` is not automatically set - it
will only contain a value if one is assigned to it. *FSLeyes*
does this during startup, in the :func:`fsleyes.gl.bootstrap`
function. A value can be assigend directly to an attribute on
the ``glVersion`` function called ``version``, e.g.;;
import fsl.utils.platform as plat
plat.glVersion.version = '2.1'
"""
return getattr(glVersion, 'version', None)
def glRenderer():
"""Return the OpenGL renderer description.
.. note:: The values of ``glRenderer`` is not automatically set - it
will only contain a value if one is assigned to it. *FSLeyes*
does this during startup, in the :func:`fsleyes.gl.bootstrap`
function. A value can be assigend directly to an attribute on
the ``glRenderer`` function called ``renderer``, e.g.;;
import fsl.utils.platform as plat
plat.glRenderer.renderer = 'Mesa DRI Intel(R) UHD ' \
'Graphics 620 (WHL GT2)'
"""
return getattr(glRenderer, 'renderer', None)
def glIsSoftwareRenderer():
"""Returns ``True`` if the OpenGL renderer appears to be software based,
``False`` otherwise, or ``None`` if the renderer has not yet been set.
.. note:: This check is based on heuristics, ans is not guaranteed to
be correct.
"""
renderer = glRenderer()
if renderer is None:
return None
# There doesn't seem to be any quantitative
# method for determining whether we are using
# software-based rendering, so a hack is
# necessary.
renderer = renderer.lower()
return any(('software' in renderer,
'chromium' in renderer))
def isalive(widget): def isalive(widget):
"""Returns ``True`` if the given ``wx.Window`` object is "alive" (i.e. has """Returns ``True`` if the given ``wx.Window`` object is "alive" (i.e. has
not been destroyed), ``False`` otherwise. Works in both wxPython and not been destroyed), ``False`` otherwise. Works in both wxPython and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment