From 259bad2b3180eed892bf60698828d67aaa02c9b8 Mon Sep 17 00:00:00 2001 From: Bryan Wyatt Date: Sun, 1 Dec 2019 11:52:38 -0800 Subject: [PATCH] Rename usage of `conf` to `config` --- src/ophiuchus/cli/build.py | 4 +++- src/ophiuchus/cli/runlocal.py | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ophiuchus/cli/build.py b/src/ophiuchus/cli/build.py index c6ae7ce..39aa80a 100644 --- a/src/ophiuchus/cli/build.py +++ b/src/ophiuchus/cli/build.py @@ -55,7 +55,9 @@ def __call__( *args, **kwargs, ): - conf = GlobalConfig(endpoints=dict(additional_endpoints)) # noqa: F841 + config = GlobalConfig( # noqa: F841 + endpoints=dict(additional_endpoints), + ) self.log.info(f"Cleaning old artifacts dir: {artifacts_base_dir}") rmtree(artifacts_base_dir) diff --git a/src/ophiuchus/cli/runlocal.py b/src/ophiuchus/cli/runlocal.py index 3066d03..2ba385c 100644 --- a/src/ophiuchus/cli/runlocal.py +++ b/src/ophiuchus/cli/runlocal.py @@ -73,7 +73,7 @@ async def wrapper(request): async def start_site( site_group: str, - conf: GlobalConfig, + config: GlobalConfig, address: str = "127.0.0.1", port: int = 3000, allow_unsupported_routes: bool = False, @@ -83,7 +83,7 @@ async def start_site( for handler_name, handler_class in load_entry_points( site_group, Handler, ).items(): - handler = handler_class(conf) + handler = handler_class(config) for route, verb in itertools.product( routes[f"{handler_class.__module__}.{handler_class.__name__}"], [ @@ -181,7 +181,7 @@ def __call__( *args, **kwargs, ) -> int: - conf = GlobalConfig(endpoints=dict(additional_endpoints)) + config = GlobalConfig(endpoints=dict(additional_endpoints)) loop = asyncio.get_event_loop() port = first_listen_port @@ -190,13 +190,13 @@ def __call__( loop.create_task( start_site( site_group, - conf, + config, address=listen_address, port=port, allow_unsupported_routes=allow_unsupported_routes, ), ) - conf.add_endpoint(site_group, f"http://{listen_address}:{port}") + config.add_endpoint(site_group, f"http://{listen_address}:{port}") port += 1 try: