-
Notifications
You must be signed in to change notification settings - Fork 11
/
manage.py
executable file
·42 lines (33 loc) · 1.34 KB
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python
from requests.utils import unquote
from flask_script import Manager, Server
from compair.manage.database import manager as database_manager
from compair.manage.report import manager as report_generator
from compair.manage.grades import manager as grades_generator
from compair.manage.score import manager as score_generator
from compair.manage.user import manager as user_manager
from compair.manage.utils import manager as util_manager
from compair.manage.kaltura import manager as kaltura_manager
from compair import create_app
manager = Manager(create_app(skip_assets=True))
# register sub-managers
manager.add_command("database", database_manager)
manager.add_command("report", report_generator)
manager.add_command("grades", grades_generator)
manager.add_command("score", score_generator)
manager.add_command("runserver", Server(port=8080))
manager.add_command("user", user_manager)
manager.add_command("util", util_manager)
manager.add_command("kaltura", kaltura_manager)
@manager.command
def list_routes():
import urllib
output = []
for rule in manager.app.url_map.iter_rules():
methods = ','.join(rule.methods)
line = unquote("{:50s} {:20s} {}".format(rule.endpoint, methods, rule))
output.append(line)
for line in sorted(output):
print(line)
if __name__ == "__main__":
manager.run()