def _load_config(file_path):
    abs_path = os.path.abspath(file_path)
    if not os.path.exists(abs_path):
        raise AssertionError('pycsw config file {0} does not exist.'.format(abs_path))

    config = SafeConfigParser()
    config.read(abs_path)

    return config
Esempio n. 2
0
def _load_config(file_path):
    abs_path = os.path.abspath(file_path)
    if not os.path.exists(abs_path):
        raise AssertionError(
            'pycsw config file {0} does not exist.'.format(abs_path))

    config = SafeConfigParser()
    config.read(abs_path)

    return config
def _load_config(file_path):
    """Load pyCSW configuration
    """

    abs_path = os.path.abspath(file_path)
    if not os.path.exists(abs_path):
        raise ValueError("pycsw config file %s does not exist." % (abs_path))

    config = SafeConfigParser()
    config.read(abs_path)

    log1.info("Read pyCSW config from %s" % (file_path))
    return config
Esempio n. 4
0
def _load_config(file_path):
    '''Load pyCSW configuration
    '''

    abs_path = os.path.abspath(file_path)
    if not os.path.exists(abs_path):
        raise ValueError('pycsw config file %s does not exist.' % (abs_path))

    config = SafeConfigParser()
    config.read(abs_path)

    log1.info('Read pyCSW config from %s' % (file_path))
    return config
def _load_config(file_path):
    """
    Lifted from ckanext-spatial/bin/ckan_pycsw.py
    Loads the PyCSW configuration file.

    @param file_path: location of configuration file in the file system
    @return: configuration object
    """
    abs_path = os.path.abspath(file_path)
    if not os.path.exists(abs_path):
        raise AssertionError('pycsw config file {0} does not exist.'.format(abs_path))
    config = SafeConfigParser()
    config.read(abs_path)
    return config
Esempio n. 6
0
def _load_config(file_path):
    """
    Lifted from ckanext-spatial/bin/ckan_pycsw.py
    Loads the PyCSW configuration file.

    @param file_path: location of configuration file in the file system
    @return: configuration object
    """
    abs_path = os.path.abspath(file_path)
    if not os.path.exists(abs_path):
        raise AssertionError(
            'pycsw config file {0} does not exist.'.format(abs_path))
    config = SafeConfigParser()
    config.read(abs_path)
    return config