summaryrefslogtreecommitdiffstats
path: root/manage.py
diff options
context:
space:
mode:
Diffstat (limited to 'manage.py')
-rwxr-xr-xmanage.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/manage.py b/manage.py
index 8149ff1..6e9a596 100755
--- a/manage.py
+++ b/manage.py
@@ -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()