Home / File/ blueprints.py — flask Source File

blueprints.py — flask Source File

Architecture documentation for blueprints.py, a python file in the flask codebase. 11 imports, 1 dependents.

File python ApplicationCore Scaffolding 11 imports 1 dependents 1 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  758a865d_0775_4c38_5582_499379448d06["blueprints.py"]
  ef067598_b87b_459b_7a19_f6c8df8fd2e4["ef067598:b87b:459b:7a19:f6c8df8fd2e4"]
  758a865d_0775_4c38_5582_499379448d06 --> ef067598_b87b_459b_7a19_f6c8df8fd2e4
  b48dce3f_427c_079b_4c4a_8f5873f5b51f["scaffold.py"]
  758a865d_0775_4c38_5582_499379448d06 --> b48dce3f_427c_079b_4c4a_8f5873f5b51f
  dd1e88a5_022f_b7a5_beb9_d356fce722be["_endpoint_from_view_func"]
  758a865d_0775_4c38_5582_499379448d06 --> dd1e88a5_022f_b7a5_beb9_d356fce722be
  a813bd5c_bf41_d926_8dde_6a113d5e0018["Scaffold"]
  758a865d_0775_4c38_5582_499379448d06 --> a813bd5c_bf41_d926_8dde_6a113d5e0018
  82a2ebca_28b9_36f9_fc57_965b07665f6d["setupmethod"]
  758a865d_0775_4c38_5582_499379448d06 --> 82a2ebca_28b9_36f9_fc57_965b07665f6d
  ed6b5ded_713e_74a7_fd38_486c9303d21c["app.py"]
  758a865d_0775_4c38_5582_499379448d06 --> ed6b5ded_713e_74a7_fd38_486c9303d21c
  38f6d4a2_834e_2acd_e1b6_f45c58079ccd["App"]
  758a865d_0775_4c38_5582_499379448d06 --> 38f6d4a2_834e_2acd_e1b6_f45c58079ccd
  bdc6911d_da67_3a1f_90cb_90f5e9f0603e["os"]
  758a865d_0775_4c38_5582_499379448d06 --> bdc6911d_da67_3a1f_90cb_90f5e9f0603e
  852dc50b_4da6_57dc_ead7_cdd90925e0b8["typing"]
  758a865d_0775_4c38_5582_499379448d06 --> 852dc50b_4da6_57dc_ead7_cdd90925e0b8
  8fd3515c_7e50_5f0a_b0b8_f61f07875a2c["collections"]
  758a865d_0775_4c38_5582_499379448d06 --> 8fd3515c_7e50_5f0a_b0b8_f61f07875a2c
  3eebf5bc_1ef0_6524_701b_beec8ec8524a["functools"]
  758a865d_0775_4c38_5582_499379448d06 --> 3eebf5bc_1ef0_6524_701b_beec8ec8524a
  ed6b5ded_713e_74a7_fd38_486c9303d21c["app.py"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 758a865d_0775_4c38_5582_499379448d06
  style 758a865d_0775_4c38_5582_499379448d06 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from __future__ import annotations

import os
import typing as t
from collections import defaultdict
from functools import update_wrapper

from .. import typing as ft
from .scaffold import _endpoint_from_view_func
from .scaffold import _sentinel
from .scaffold import Scaffold
from .scaffold import setupmethod

if t.TYPE_CHECKING:  # pragma: no cover
    from .app import App

DeferredSetupFunction = t.Callable[["BlueprintSetupState"], None]
T_after_request = t.TypeVar("T_after_request", bound=ft.AfterRequestCallable[t.Any])
T_before_request = t.TypeVar("T_before_request", bound=ft.BeforeRequestCallable)
T_error_handler = t.TypeVar("T_error_handler", bound=ft.ErrorHandlerCallable)
T_teardown = t.TypeVar("T_teardown", bound=ft.TeardownCallable)
T_template_context_processor = t.TypeVar(
    "T_template_context_processor", bound=ft.TemplateContextProcessorCallable
)
T_template_filter = t.TypeVar("T_template_filter", bound=ft.TemplateFilterCallable)
T_template_global = t.TypeVar("T_template_global", bound=ft.TemplateGlobalCallable)
T_template_test = t.TypeVar("T_template_test", bound=ft.TemplateTestCallable)
T_url_defaults = t.TypeVar("T_url_defaults", bound=ft.URLDefaultCallable)
T_url_value_preprocessor = t.TypeVar(
    "T_url_value_preprocessor", bound=ft.URLValuePreprocessorCallable
)


class BlueprintSetupState:
    """Temporary holder object for registering a blueprint with the
    application.  An instance of this class is created by the
    :meth:`~flask.Blueprint.make_setup_state` method and later passed
    to all register callback functions.
    """

    def __init__(
        self,
        blueprint: Blueprint,
        app: App,
        options: t.Any,
        first_registration: bool,
    ) -> None:
        #: a reference to the current application
        self.app = app

        #: a reference to the blueprint that created this setup state.
        self.blueprint = blueprint

        #: a dictionary with all options that were passed to the
        #: :meth:`~flask.Flask.register_blueprint` method.
        self.options = options

        #: as blueprints can be registered multiple times with the
        #: application and not everything wants to be registered
        #: multiple times on it, this attribute can be used to figure
// ... (633 more lines)

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does blueprints.py do?
blueprints.py is a source file in the flask codebase, written in python. It belongs to the ApplicationCore domain, Scaffolding subdomain.
What functions are defined in blueprints.py?
blueprints.py defines 1 function(s): app.
What does blueprints.py depend on?
blueprints.py imports 11 module(s): App, Scaffold, _endpoint_from_view_func, app.py, collections, ef067598:b87b:459b:7a19:f6c8df8fd2e4, functools, os, and 3 more.
What files import blueprints.py?
blueprints.py is imported by 1 file(s): app.py.
Where is blueprints.py in the architecture?
blueprints.py is located at src/flask/sansio/blueprints.py (domain: ApplicationCore, subdomain: Scaffolding, directory: src/flask/sansio).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free