Changes in trunk/python/env.py [1848:1859]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/env.py
r1848 r1859 1 __all__ = ["is_casapy", "is_ipython", "setup_env", "get_revision"] 1 """This module has various functions for environment specific setings. 2 """ 3 __all__ = ["is_casapy", "is_ipython", "setup_env", "get_revision", 4 "is_asap_cli"] 2 5 3 6 import sys … … 7 10 8 11 def is_casapy(): 12 """Are we running inside casapy?""" 9 13 try: 10 14 from taskinit import casalog … … 14 18 15 19 def is_ipython(): 20 """Are we running inside IPython?""" 16 21 return 'IPython' in sys.modules.keys() 17 22 23 def is_asap_cli(): 24 """Are we running inside asap ipython (but not casapy)""" 25 return is_ipython() and not is_casapy() 26 18 27 def setup_env(): 28 """Set-up environment variables for casa and initialise ~/.asap on first 29 use. 30 """ 19 31 # Set up CASAPATH and first time use of asap i.e. ~/.asap/* 20 32 plf = None … … 59 71 60 72 def get_revision(): 73 """Get the revision of the software. Only useful within casapy.""" 61 74 if not is_casapy: 62 75 return ' unknown '
Note:
See TracChangeset
for help on using the changeset viewer.