Skip to content

Commit

Permalink
Refs #master python not sh
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Jun 6, 2019
1 parent f8b312a commit 142900f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions crystalplan.py
Original file line number Diff line number Diff line change
@@ -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 <<END

"""The CrystalPlan application.
CrystalPlan is an experiment planning tool for crystallography.
You can choose an instrument and supply your sample's lattice
parameters to simulate which reflections will be measured,
by which detectors and at what wavelengths.
Author: Janik Zikovsky, zikovskyjl@ornl.gov
Version: $Id$
"""
# Author: Janik Zikovsky, zikovskyjl@ornl.gov
# Version: $Id$

#Simply import and launch the GUI
import CrystalPlan.gui.main
CrystalPlan.gui.main.handle_arguments_and_launch(InstalledVersion=True)
END
os.system(VGLRUN +" /usr/bin/python <<END\n"\
"import CrystalPlan.gui.main\n"\
"CrystalPlan.gui.main.handle_arguments_and_launch(InstalledVersion=True)\n"\
"END")

0 comments on commit 142900f

Please sign in to comment.