MCPcopy Index your code
hub / github.com/plotly/dash / enable_compression

Method enable_compression

dash/backends/_quart.py:448–464  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

446 )
447
448 def enable_compression(self) -> None:
449 try:
450 import quart_compress # pylint: disable=import-outside-toplevel
451
452 Compress = quart_compress.Compress
453 Compress(self.server)
454 _flask_compress_version = parse_version(
455 _get_distribution_version("quart_compress")
456 )
457 if not hasattr(
458 self.server.config, "COMPRESS_ALGORITHM"
459 ) and _flask_compress_version >= parse_version("1.6.0"):
460 self.server.config["COMPRESS_ALGORITHM"] = ["gzip"]
461 except ImportError as error:
462 raise ImportError(
463 "To use the compress option, you need to install quart_compress."
464 ) from error
465
466 async def _run_ws_hooks(
467 self, hooks, ws, *args, default_reason: str = "Rejected"

Callers

nothing calls this directly

Calls 1

parse_versionFunction · 0.90

Tested by

no test coverage detected