[X2Go-Commits] [x2goclient] 47/94: pyhoca-cli main programme: Check for DISPLAY env var being set and having a usable / expectable value.
git-admin at x2go.org
git-admin at x2go.org
Fri Dec 15 21:06:41 CET 2023
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to annotated tag 0.6.1.0
in repository x2goclient.
commit 48793e7f8420ddd902bb61c45fbb1ddf18341b54
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Wed May 16 08:45:01 2018 +0000
pyhoca-cli main programme: Check for DISPLAY env var being set and having a usable / expectable value.
---
pyhoca-cli | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pyhoca-cli b/pyhoca-cli
index 34387415..447969b1 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -30,6 +30,7 @@ import x2go
import sys
import os
+import re
PROG_NAME = os.path.basename(sys.argv[0]).replace('.exe', '')
PROG_PID = os.getpid()
@@ -424,6 +425,12 @@ if __name__ == '__main__':
parser, args = parseargs()
args.parser = parser
+ if not os.environ.get('DISPLAY'):
+ logger('the display environment variable is unset, can\'t go on without a DISPLAY...', x2go.loglevel_ERROR, )
+ sys.exit(1)
+ elif not re.match("^.*:[0-9]+(|\.[0-9]+)$", os.environ.get('DISPLAY')):
+ logger('the display environment variable\'s value is weird ({val}), can\'t go on with that...'.format(val=os.environ.get('DISPLAY')), x2go.loglevel_ERROR, )
+ sys.exit(1)
try:
# initialize the X2GoClient context and start the connection to the X2Go server
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list