def download_passband(passband, local=True):
    """
    Download and install a given passband from the repository.

    If local=False, you must have permission to access the installation directory
    """
    if passband not in list_online_passbands():
        raise ValueError("passband '{}' not available".format(passband))

    pbdir = _pbdir_local if local else _pbdir_global

    passband_fname = _online_passbands[passband]['fname']
    passband_fname_local = os.path.join(pbdir, passband_fname)
    url = 'http://github.com/phoebe-project/phoebe2-tables/raw/master/passbands/{}'.format(passband_fname)
    logger.info("downloading from {} and installing to {}...".format(url, passband_fname_local))
    try:
        urllib.urlretrieve(url, passband_fname_local)
    except IOError:
        raise IOError("unable to download {} passband - check connection".format(passband))
    else:
        init_passband(passband_fname_local)
def download_passband ( passband , local = True ) : if passband not in list_online_passbands ( ) : raise ValueError ( "passband '{}' not available" . format ( passband ) ) pbdir = _pbdir_local if local else _pbdir_global passband_fname = _online_passbands [ passband ] [ 'fname' ] passband_fname_local = os . path . join ( pbdir , passband_fname ) url = 'http://github.com/phoebe-project/phoebe2-tables/raw/master/passbands/{}' . format ( passband_fname ) logger . info ( "downloading from {} and installing to {}..." . format ( url , passband_fname_local ) ) try : urllib . urlretrieve ( url , passband_fname_local ) except IOError : raise IOError ( "unable to download {} passband - check connection" . format ( passband ) ) else : init_passband ( passband_fname_local )
Download and install a given passband from the repository.

    If local=False, you must have permission to access the installation directory