Ignore:
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"]
    25
    36import sys
     
    710
    811def is_casapy():
     12    """Are we running inside casapy?"""
    913    try:
    1014        from taskinit import casalog
     
    1418
    1519def is_ipython():
     20    """Are we running inside IPython?"""
    1621    return 'IPython' in sys.modules.keys()
    1722
     23def is_asap_cli():
     24    """Are we running inside asap ipython (but not casapy)"""
     25    return is_ipython() and not is_casapy()
     26
    1827def setup_env():
     28    """Set-up environment variables for casa and initialise ~/.asap on first
     29    use.
     30    """
    1931    # Set up CASAPATH and first time use of asap i.e. ~/.asap/*
    2032    plf = None
     
    5971
    6072def get_revision():
     73    """Get the revision of the software. Only useful within casapy."""
    6174    if not is_casapy:
    6275        return ' unknown '
Note: See TracChangeset for help on using the changeset viewer.