__init__.py 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. from __future__ import annotations
  2. import typing as t
  3. from .accept import Accept as Accept
  4. from .accept import CharsetAccept as CharsetAccept
  5. from .accept import LanguageAccept as LanguageAccept
  6. from .accept import MIMEAccept as MIMEAccept
  7. from .auth import Authorization as Authorization
  8. from .auth import WWWAuthenticate as WWWAuthenticate
  9. from .cache_control import RequestCacheControl as RequestCacheControl
  10. from .cache_control import ResponseCacheControl as ResponseCacheControl
  11. from .csp import ContentSecurityPolicy as ContentSecurityPolicy
  12. from .etag import ETags as ETags
  13. from .file_storage import FileMultiDict as FileMultiDict
  14. from .file_storage import FileStorage as FileStorage
  15. from .headers import EnvironHeaders as EnvironHeaders
  16. from .headers import Headers as Headers
  17. from .mixins import ImmutableDictMixin as ImmutableDictMixin
  18. from .mixins import ImmutableHeadersMixin as ImmutableHeadersMixin
  19. from .mixins import ImmutableListMixin as ImmutableListMixin
  20. from .mixins import ImmutableMultiDictMixin as ImmutableMultiDictMixin
  21. from .mixins import UpdateDictMixin as UpdateDictMixin
  22. from .range import ContentRange as ContentRange
  23. from .range import IfRange as IfRange
  24. from .range import Range as Range
  25. from .structures import CallbackDict as CallbackDict
  26. from .structures import CombinedMultiDict as CombinedMultiDict
  27. from .structures import HeaderSet as HeaderSet
  28. from .structures import ImmutableDict as ImmutableDict
  29. from .structures import ImmutableList as ImmutableList
  30. from .structures import ImmutableMultiDict as ImmutableMultiDict
  31. from .structures import ImmutableTypeConversionDict as ImmutableTypeConversionDict
  32. from .structures import iter_multi_items as iter_multi_items
  33. from .structures import MultiDict as MultiDict
  34. from .structures import TypeConversionDict as TypeConversionDict
  35. def __getattr__(name: str) -> t.Any:
  36. import warnings
  37. if name == "OrderedMultiDict":
  38. from .structures import _OrderedMultiDict
  39. warnings.warn(
  40. "'OrderedMultiDict' is deprecated and will be removed in Werkzeug"
  41. " 3.2. Use 'MultiDict' instead.",
  42. DeprecationWarning,
  43. stacklevel=2,
  44. )
  45. return _OrderedMultiDict
  46. if name == "ImmutableOrderedMultiDict":
  47. from .structures import _ImmutableOrderedMultiDict
  48. warnings.warn(
  49. "'OrderedMultiDict' is deprecated and will be removed in Werkzeug"
  50. " 3.2. Use 'ImmutableMultiDict' instead.",
  51. DeprecationWarning,
  52. stacklevel=2,
  53. )
  54. return _ImmutableOrderedMultiDict
  55. raise AttributeError(name)