Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add init_app() method to DebugPanel base class #95

Merged

Conversation

malthejorgensen
Copy link
Contributor

Adds a method DebugPanel.init_app() that gets called from DebugToolbar.init_app().

This allows DebugPanels to register their own routes, and do setup work that should go across requests (as opposed to per-request setup) and needs access to the Flask app-object.


Example::

class UMLDiagramPanel(DebugPanel):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Copy link
Contributor Author

@malthejorgensen malthejorgensen Jun 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably :)
What specifically are you referring to?

Copy link

@illume illume Jun 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's stuff about UMLDiagramPanel in there that I don't think is correct?

Oh, that's an example. Never mind.

@jeffwidman jeffwidman changed the title Add init_app()-method to DebugPanel base class Add init_app() method to DebugPanel base class Mar 2, 2020
@macnewbold
Copy link
Contributor

I know it's been a long time, but do you still have any interest in this?
If so, it will need to catch it up with master and retest. If not, we'll probably close it out.

Adds a method `DebugPanel.init_app()` that gets called from
`DebugToolbar.init_app()`.

This allows DebugPanels to register their own routes, and do setup work
that should go across requests (as opposed to per-request setup) and
needs access to the Flask `app`-object.
@malthejorgensen
Copy link
Contributor Author

@macnewbold Thank you for the flag. I've rebased on latest master now

Copy link
Contributor

@macnewbold macnewbold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. I think this is a very handy hook to add to the collection for users to adjust behavior.

@macnewbold macnewbold merged commit b7f5a72 into pallets-eco:master Dec 20, 2023
10 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

3 participants