Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fsleyes
fsleyes-widgets
Commits
81fbc3c5
Commit
81fbc3c5
authored
Feb 18, 2021
by
Paul McCarthy
🚵
Browse files
RF: What's the point in having these functions in this library? They can be
moved into fsleyes
parent
34128320
Changes
2
Show whitespace changes
Inline
Side-by-side
fsleyes_widgets/__init__.py
View file @
81fbc3c5
...
...
@@ -36,7 +36,4 @@ from fsleyes_widgets.utils import (WX_PYTHON, # noqa
haveGui
,
inSSHSession
,
inVNCSession
,
glVersion
,
glRenderer
,
glIsSoftwareRenderer
,
isalive
)
fsleyes_widgets/utils/__init__.py
View file @
81fbc3c5
...
...
@@ -18,9 +18,6 @@ random things. A few functions are also defined at the package level:
haveGui
inSSHSession
inVNCSession
glVersion
glRenderer
glIsSoftwareRenderer
isalive
...
...
@@ -222,56 +219,6 @@ def inVNCSession():
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
):
"""Returns ``True`` if the given ``wx.Window`` object is "alive" (i.e. has
not been destroyed), ``False`` otherwise. Works in both wxPython and
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment