Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
5544712a
Commit
5544712a
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted platform SSH session detection. Now there is a separate property for
VNC-like environments.
parent
045b521f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/utils/platform.py
+21
-10
21 additions, 10 deletions
fsl/utils/platform.py
with
21 additions
and
10 deletions
fsl/utils/platform.py
+
21
−
10
View file @
5544712a
...
@@ -146,6 +146,7 @@ class Platform(notifier.Notifier):
...
@@ -146,6 +146,7 @@ class Platform(notifier.Notifier):
self
.
isWidgetAlive
=
isWidgetAlive
self
.
isWidgetAlive
=
isWidgetAlive
self
.
__inSSHSession
=
False
self
.
__inSSHSession
=
False
self
.
__inVNCSession
=
False
self
.
__glVersion
=
None
self
.
__glVersion
=
None
self
.
__glRenderer
=
None
self
.
__glRenderer
=
None
self
.
__glIsSoftware
=
None
self
.
__glIsSoftware
=
None
...
@@ -163,17 +164,14 @@ class Platform(notifier.Notifier):
...
@@ -163,17 +164,14 @@ class Platform(notifier.Notifier):
except
ImportError
:
except
ImportError
:
self
.
__canHaveGui
=
False
self
.
__canHaveGui
=
False
# If one of the SSH_/VNC environment
# variables is set, then we're probably
# running over SSH/VNC.
sshVars
=
[
'
SSH_CLIENT
'
,
'
SSH_TTY
'
]
vncVars
=
[
'
VNCDESKTOP
'
,
'
X2GO_SESSION
'
,
'
NXSESSIONID
'
]
# If one of the SSH_ environment
self
.
__inSSHSession
=
any
(
s
in
os
.
environ
for
s
in
sshVars
)
# variables is set, and we're
self
.
__inVNCSession
=
any
(
v
in
os
.
environ
for
v
in
vncVars
)
# not running in a VNC session,
# then we're probably running
# over SSH.
inSSH
=
'
SSH_CLIENT
'
in
os
.
environ
or
\
'
SSH_TTY
'
in
os
.
environ
inVNC
=
'
VNCDESKTOP
'
in
os
.
environ
self
.
__inSSHSession
=
inSSH
and
not
inVNC
@property
@property
...
@@ -220,6 +218,19 @@ class Platform(notifier.Notifier):
...
@@ -220,6 +218,19 @@ class Platform(notifier.Notifier):
return
self
.
__inSSHSession
return
self
.
__inSSHSession
@property
def
inVNCSession
(
self
):
"""
``True`` if this application is running over a VNC (or similar)
session, ``False`` otherwise. Currently, the following remote desktop
environments are detected:
- VNC
- x2go
- NoMachine
"""
return
self
.
__inVNCSession
@property
@property
def
wxPlatform
(
self
):
def
wxPlatform
(
self
):
"""
One of :data:`WX_UNKNOWN`, :data:`WX_MAC_COCOA`,
"""
One of :data:`WX_UNKNOWN`, :data:`WX_MAC_COCOA`,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment