__init__.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from markupsafe import escape
  2. from markupsafe import Markup
  3. from . import json as json
  4. from .app import Flask as Flask
  5. from .app import Request as Request
  6. from .app import Response as Response
  7. from .blueprints import Blueprint as Blueprint
  8. from .config import Config as Config
  9. from .ctx import after_this_request as after_this_request
  10. from .ctx import copy_current_request_context as copy_current_request_context
  11. from .ctx import has_app_context as has_app_context
  12. from .ctx import has_request_context as has_request_context
  13. from .globals import current_app as current_app
  14. from .globals import g as g
  15. from .globals import request as request
  16. from .globals import session as session
  17. from .helpers import abort as abort
  18. from .helpers import flash as flash
  19. from .helpers import get_flashed_messages as get_flashed_messages
  20. from .helpers import get_template_attribute as get_template_attribute
  21. from .helpers import make_response as make_response
  22. from .helpers import redirect as redirect
  23. from .helpers import send_file as send_file
  24. from .helpers import send_from_directory as send_from_directory
  25. from .helpers import stream_with_context as stream_with_context
  26. from .helpers import url_for as url_for
  27. from .json import jsonify as jsonify
  28. from .signals import appcontext_popped as appcontext_popped
  29. from .signals import appcontext_pushed as appcontext_pushed
  30. from .signals import appcontext_tearing_down as appcontext_tearing_down
  31. from .signals import before_render_template as before_render_template
  32. from .signals import got_request_exception as got_request_exception
  33. from .signals import message_flashed as message_flashed
  34. from .signals import request_finished as request_finished
  35. from .signals import request_started as request_started
  36. from .signals import request_tearing_down as request_tearing_down
  37. from .signals import signals_available as signals_available
  38. from .signals import template_rendered as template_rendered
  39. from .templating import render_template as render_template
  40. from .templating import render_template_string as render_template_string
  41. from .templating import stream_template as stream_template
  42. from .templating import stream_template_string as stream_template_string
  43. __version__ = "2.2.2"
  44. def __getattr__(name):
  45. if name == "_app_ctx_stack":
  46. import warnings
  47. from .globals import __app_ctx_stack
  48. warnings.warn(
  49. "'_app_ctx_stack' is deprecated and will be removed in Flask 2.3.",
  50. DeprecationWarning,
  51. stacklevel=2,
  52. )
  53. return __app_ctx_stack
  54. if name == "_request_ctx_stack":
  55. import warnings
  56. from .globals import __request_ctx_stack
  57. warnings.warn(
  58. "'_request_ctx_stack' is deprecated and will be removed in Flask 2.3.",
  59. DeprecationWarning,
  60. stacklevel=2,
  61. )
  62. return __request_ctx_stack
  63. raise AttributeError(name)