diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-19 16:26:40 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-19 16:26:40 +0800 |
commit | 2aaf7d8106e7d596654c9ae1cf0fa75fd642f3eb (patch) | |
tree | b524d1fa54a4ad6251d467175b71e9dfea5a6631 /scripts/setup_pfiles.py | |
parent | 89adbc474890c50963537e8e32bdeff8aa3e10d1 (diff) | |
download | chandra-acis-analysis-2aaf7d8106e7d596654c9ae1cf0fa75fd642f3eb.tar.bz2 |
Setup module 'acispy' and clean 'scripts' directory
Setup a module 'acispy' to hold some generic Python modules for
better/easier reuse, and clean up the 'scripts' directory, which will be
used to hold the CLI tools.
Diffstat (limited to 'scripts/setup_pfiles.py')
-rw-r--r-- | scripts/setup_pfiles.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/scripts/setup_pfiles.py b/scripts/setup_pfiles.py deleted file mode 100644 index 8a80a14..0000000 --- a/scripts/setup_pfiles.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2017 Weitian LI <liweitianux@live.com> -# MIT license -# -# Weitian LI -# 2017-02-06 - -""" -Prepare the CIAO parameter files and setup the PFILES environment -variable to keep the pfiles locally, in order to avoid the conflicts -between multiple instance of the same CIAO tools. -""" - -import os -import subprocess -import shutil - - -def setup_pfiles(tools): - """ - Copy the parameter files of the specified tools to the current - working directory, and setup the ``PFILES`` environment variable. - - Parameters - ---------- - tools : list[str] - Name list of the tools to be set up - """ - for tool in tools: - pfile = subprocess.check_output([ - "paccess", tool - ]).decode("utf-8").strip() - subprocess.check_call(["punlearn", tool]) - try: - shutil.copy(pfile, ".") - except shutil.SameFileError: - pass - # Setup the ``PFILES`` environment variable - os.environ["PFILES"] = "./:" + os.environ["PFILES"] |