def _retrieve_download_url():
    """
    Retrieves download location for FEH data zip file from hosted json configuration file.

    :return: URL for FEH data file
    :rtype: str
    """
    try:
        # Try to obtain the url from the Open Hydrology json config file.
        with urlopen(config['nrfa']['oh_json_url'], timeout=10) as f:
            remote_config = json.loads(f.read().decode('utf-8'))
        # This is just for testing, assuming a relative local file path starting with ./
        if remote_config['nrfa_url'].startswith('.'):
            remote_config['nrfa_url'] = 'file:' + pathname2url(os.path.abspath(remote_config['nrfa_url']))

        # Save retrieved config data
        _update_nrfa_metadata(remote_config)

        return remote_config['nrfa_url']
    except URLError:
        # If that fails (for whatever reason) use the fallback constant.
        return config['nrfa']['url']
def _retrieve_download_url ( ) : try : with urlopen ( config [ 'nrfa' ] [ 'oh_json_url' ] , timeout = 10 ) as f : remote_config = json . loads ( f . read ( ) . decode ( 'utf-8' ) ) if remote_config [ 'nrfa_url' ] . startswith ( '.' ) : remote_config [ 'nrfa_url' ] = 'file:' + pathname2url ( os . path . abspath ( remote_config [ 'nrfa_url' ] ) ) _update_nrfa_metadata ( remote_config ) return remote_config [ 'nrfa_url' ] except URLError : return config [ 'nrfa' ] [ 'url' ]
Retrieves download location for FEH data zip file from hosted json configuration file.

    :return: URL for FEH data file
    :rtype: str