Skip to content

Commit f3c19b3

Browse files
committed
0.2.12
1 parent 8ddbe52 commit f3c19b3

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "viser"
7-
version = "0.2.11"
7+
version = "0.2.12"
88
description = "3D visualization + Python"
99
readme = "README.md"
1010
license = { text="MIT" }

src/viser/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from ._scene_handles import HemisphereLightHandle as HemisphereLightHandle
3636
from ._scene_handles import ImageHandle as ImageHandle
3737
from ._scene_handles import LabelHandle as LabelHandle
38+
from ._scene_handles import LineSegmentsHandle as LineSegmentsHandle
3839
from ._scene_handles import MeshHandle as MeshHandle
3940
from ._scene_handles import MeshSkinnedBoneHandle as MeshSkinnedBoneHandle
4041
from ._scene_handles import MeshSkinnedHandle as MeshSkinnedHandle

src/viser/infra/_infra.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,6 @@ async def ws_handler(
315315
connection: websockets.asyncio.server.ServerConnection,
316316
) -> None:
317317
"""Handler for websocket connections."""
318-
319-
# <Hack>
320-
# Suppress errors for: https://github.com/python-websockets/websockets/issues/1513
321-
# TODO: remove this when websockets behavior changes upstream.
322-
class NoHttpErrors(logging.Filter):
323-
def filter(self, record):
324-
return not record.getMessage() == "opening handshake failed"
325-
326-
connection.logger.logger.addFilter(NoHttpErrors()) # type: ignore
327-
# </Hack>
328-
329318
async with count_lock:
330319
nonlocal connection_count
331320
client_id = ClientId(connection_count)
@@ -414,10 +403,26 @@ def handle_incoming(message: Message) -> None:
414403
file_cache: dict[Path, bytes] = {}
415404
file_cache_gzipped: dict[Path, bytes] = {}
416405

406+
filter_added = False
407+
417408
def viser_http_server(
418409
connection: ServerConnection,
419410
request: Request,
420411
) -> Response | None:
412+
# <Hack>
413+
# Suppress errors for: https://github.com/python-websockets/websockets/issues/1513
414+
# TODO: remove this when websockets behavior changes upstream.
415+
nonlocal filter_added
416+
if not filter_added:
417+
418+
class NoHttpErrors(logging.Filter):
419+
def filter(self, record):
420+
return not record.getMessage() == "opening handshake failed"
421+
422+
connection.logger.logger.addFilter(NoHttpErrors()) # type: ignore
423+
filter_added = True
424+
# </Hack>
425+
421426
# Ignore websocket packets.
422427
if request.headers.get("Upgrade") == "websocket":
423428
return None

0 commit comments

Comments
 (0)