Path 1: 26 calls (1.0)

Blueprint.add_app_template_filter..register_template def (9) Blueprint.add_app_template_test..register_template def (9) Blueprint.app_...

1@setupmethod
2    def record_once(self, func: t.Callable) -> None:
3        """Works like :meth:`record` but wraps the function in another
4        function that will ensure the function is only called once.  If the
5        blueprint is registered a second time on the application, the
6        function passed is not called.
7        """
8
9        def wrapper(state: BlueprintSetupState) -> None:
10            if state.first_registration:
11                func(state)
12
13        self.record(update_wrapper(wrapper, func))