Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(10)  |  Derive(0)  |  Import(2)
Load system wide base configuration.

:param config_file: the file name of the mapproxy.yaml configuration.
                    if ``None``, load the internal proxylib/default.yaml conf
:param clear_existing: if ``True`` remove the existing configuration settings,
                       else overwrite the settings.

        def load_base_config(config_file=None, clear_existing=False):
    """
    Load system wide base configuration.

    :param config_file: the file name of the mapproxy.yaml configuration.
                        if ``None``, load the internal proxylib/default.yaml conf
    :param clear_existing: if ``True`` remove the existing configuration settings,
                           else overwrite the settings.
    """

    if config_file is None:
        from mapproxy.config import defaults
        config_dict = {}
        for k, v in defaults.__dict__.iteritems():
            if k.startswith('_'): continue
            config_dict[k] = v
        conf_base_dir = os.getcwd()
        load_config(base_config(), config_dict=config_dict, clear_existing=clear_existing)
    else:
        conf_base_dir = os.path.abspath(os.path.dirname(config_file))
        load_config(base_config(), config_file=config_file, clear_existing=clear_existing)

    bc = base_config()
    finish_base_config(bc)

    bc.conf_base_dir = conf_base_dir
        


src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_config.py   MapProxy(Download)
from __future__ import with_statement
 
from mapproxy.config import Options, base_config, load_base_config
 
from mapproxy.test.helper import TempFiles
 
def teardown_module():
    load_base_config(clear_existing=True)
    def test_defaults(self):
        with TempFiles() as tmp:
            with open(tmp[0], 'w') as f:
                f.write(TestDefaultsLoading.defaults_yaml)
            load_base_config(config_file=tmp[0], clear_existing=True)
                """)
 
            load_base_config(config_file=tmp[0], clear_existing=True)
            load_base_config(config_file=tmp[1])
 

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_config.py   mapproxy(Download)
from __future__ import with_statement
 
from mapproxy.config import Options, base_config, load_base_config
 
from mapproxy.test.helper import TempFiles
 
def teardown_module():
    load_base_config(clear_existing=True)
    def test_defaults(self):
        with TempFiles() as tmp:
            with open(tmp[0], 'w') as f:
                f.write(TestDefaultsLoading.defaults_yaml)
            load_base_config(config_file=tmp[0], clear_existing=True)
                """)
 
            load_base_config(config_file=tmp[0], clear_existing=True)
            load_base_config(config_file=tmp[1])