diff options
Diffstat (limited to 'manage.py')
-rwxr-xr-x | manage.py | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,4 +1,5 @@ #!/usr/bin/env python +from flask import current_app from flask.ext.script import Command, Manager, Server, Shell from accounts import app @@ -7,14 +8,12 @@ from accounts.utils.console import TablePrinter class ListServices(Command): """List the configured services.""" - - def __init__(self, app): - self.app = app + name = 'list-services' def run(self): table = TablePrinter(['Name', 'URL']) table.output([(service.name, service.url) - for service in self.app.all_services]) + for service in current_app.all_services]) def main(): @@ -24,9 +23,8 @@ def main(): manager.add_command( 'debug', Server(host='::', use_debugger=True)) manager.add_command( - 'shell', Shell(make_context=lambda: dict(app=app))) - manager.add_command( - 'list-services', ListServices(app)) + 'shell', Shell()) + manager.add_command(ListServices) manager.run() |