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