Skip to content

Commit 036f11c

Browse files
committed
Minor refactoring
1 parent bd543f2 commit 036f11c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

xcengine/wrapper.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,19 @@ def main():
9292
)
9393
dataset_context.add_dataset(dataset, name, style="bar")
9494
LOGGER.info("Added " + name)
95-
with open(
95+
logo_data = (
9696
pathlib.Path(xcube.webapi.viewer.__file__).parent
9797
/ "dist"
9898
/ "images"
99-
/ "logo.png",
100-
"rb",
101-
) as fh:
102-
png = fh.read()
99+
/ "logo.png"
100+
).read_bytes()
103101

104102
viewer_context = server.ctx.get_api_ctx("viewer")
105103
viewer_context.config_items = {
106104
"config.json": json.dumps(
107105
{"server": {"url": args.xcube_viewer_api_url}, "branding": {}}
108106
),
109-
"images/logo.png": png,
107+
"images/logo.png": logo_data,
110108
}
111109
LOGGER.info(f"Starting server on port {server.ctx.config['port']}...")
112110
server.start()

0 commit comments

Comments
 (0)