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