コード例 #1
0
ファイル: __main__.py プロジェクト: fatiherikli/kuyruk
def create_config(args):
    """Creates Config object and overrides it's values from args."""
    config = Config()

    if args.config:
        # Load config file from command line option
        config.from_pyfile(args.config)
    elif args.module:
        config.from_pymodule(args.module)
    else:
        # Load config file from environment variable
        env_config = os.environ.get('KUYRUK_CONFIG')
        if env_config:
            assert os.path.isabs(env_config)
            config.from_pyfile(env_config)

    config.from_env_vars()
    config.from_cmd_args(args)
    return config
コード例 #2
0
ファイル: test_config.py プロジェクト: cenk/kuyruk
 def test_from_pymodule(self):
     """Config is loaded from Python module"""
     config = Config()
     config.from_pymodule('config2')
     self.assertEqual(config.WORKER_MAX_LOAD, 20)
コード例 #3
0
 def test_from_pymodule(self):
     """Config is loaded from Python module"""
     config = Config()
     config.from_pymodule('config2')
     self.assertEqual(config.WORKER_MAX_LOAD, 20)
コード例 #4
0
 def test_from_pymodule(self):
     config = Config()
     config.from_pymodule('config2')
     self.assertEqual(config.WORKER_MAX_LOAD, 20)
コード例 #5
0
ファイル: test_config.py プロジェクト: modulexcite/kuyruk
 def test_from_pymodule(self):
     config = Config()
     config.from_pymodule('config2')
     self.assertEqual(config.WORKER_MAX_LOAD, 20)