From 142900f48d780ba73ea11951f1e980bbe04a5acd Mon Sep 17 00:00:00 2001 From: Vickie Lynch Date: Thu, 6 Jun 2019 11:21:34 -0400 Subject: [PATCH] Refs #master python not sh --- crystalplan.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/crystalplan.py b/crystalplan.py index a4ae013..6c86807 100755 --- a/crystalplan.py +++ b/crystalplan.py @@ -1,27 +1,28 @@ -#!/bin/sh +#!/usr/bin/env python # whether or not to use vglrun -if [ -n "${NXSESSIONID}" ]; then - command -v vglrun >/dev/null 2>&1 || { echo >&2 "MantidPlot requires VirtualGL but it's not installed. Aborting."; exit 1; } +import os +if os.environ.get('NXSESSIONID') is not None: + os.system('command -v vglrun >/dev/null 2>&1 || { echo >&2 "CrystalPlan requires VirtualGL but it is not installed. Aborting."; exit 1; }') VGLRUN="vglrun" -elif [ -n "${TLSESSIONDATA}" ]; then - command -v vglrun >/dev/null 2>&1 || { echo >&2 "MantidPlot requires VirtualGL but it's not installed. Aborting."; exit 1; } +elif os.environ.get('TLSESSIONDATA') is not None: + os.system('command -v vglrun >/dev/null 2>&1 || { echo >&2 "CrystalPlan requires VirtualGL but it is not installed. Aborting."; exit 1; }') VGLRUN="vglrun" -fi -$VGLRUN /usr/bin/python <