(self)
| 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" |
nothing calls this directly
no test coverage detected