The commit 44c1c1a broke the early app access provided by #34
As a consequence, it's not possible anymore to dynamically add commands depending on an application setting.
Here what I want to be able to write:
manager = Manager(create_app)
for module in manager.app.config['PLUGINS']:
if __name__ == '__main__':
and in a plugin (ex: myapp.plugins.sample.commands):
from myapp.commands import manager
Any news on this issue ?
Not being able to register commands late or to access config early is really blocking me right now :/
That is still possible, you just need to go about it differently. From my own code:
"""Runs app-specific commands"""
capture_all_args = True
add_help = False
def __call__(self,app,args, help=False, **kwargs):
mgr = Manager(app)
app.init_manager(mgr) ## this adds a bunch of subcommands
Handling new "top-level" commands incrementally would be a major redesign of flask-script's interpreter loop. Pull requests gladly accepted.
Thanks, I will try your approach.
If I find the time and a good design, I will submit a pull-request !