Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Make available commands configurable #170

Open
italomaia opened this issue Sep 26, 2016 · 1 comment
Open

Make available commands configurable #170

italomaia opened this issue Sep 26, 2016 · 1 comment

Comments

@italomaia
Copy link

Today, I was trying to handle configurable extensions commands availability. That is, I want to be able to add commands to my manager based on the available extensions configured with my application.

The thing is, I only know which commands are to be loaded after my Flask instance was created. If it was possible to have the Flask instance created before processing commands, I could load the "dynamic" commands, per extension, with easy.

@yv
Copy link

yv commented Mar 11, 2017

This is easy as long as you don't use a decorator. I.e. instead of

@manager.command
def do_thing(parameter)

you declare the function in one place and when you're ready, do a

if ('something' in app):
   manager.command(do_thing)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants