From 34670c55db0a8b1c05e6c8cdcb5a431b6602c82b Mon Sep 17 00:00:00 2001 From: Chris Smith <csmith55@utk.edu> Date: Fri, 23 Jun 2017 09:50:12 -0400 Subject: [PATCH] New function io.io_utils.check_ssh Checks the environment to see if the code is being run over an SSH connection. --- pycroscopy/io/io_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pycroscopy/io/io_utils.py b/pycroscopy/io/io_utils.py index 5dbaff8f..1613cd3c 100644 --- a/pycroscopy/io/io_utils.py +++ b/pycroscopy/io/io_utils.py @@ -6,6 +6,7 @@ Created on Tue Nov 3 21:14:25 2015 """ from __future__ import division, print_function, absolute_import, unicode_literals +import os from multiprocessing import cpu_count from time import strftime from psutil import virtual_memory as vm @@ -18,6 +19,10 @@ __all__ = ['getAvailableMem', 'getTimeStamp', 'transformToTargetType', 'transfor 'recommendCores', 'uiGetFile'] +def check_ssh(): + return 'SSH_CLIENT' in os.environ or 'SSH_TTY' in os.environ + + def uiGetFile(filter='H5 file (*.h5)', caption='Select File'): """ Presents a File dialog used for selecting the .mat file -- GitLab