-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.py
32 lines (23 loc) · 926 Bytes
/
shell.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def load_user_ns():
from app import app, store # NOQA
app.app_context().push()
from app.models.user import User # NOQA
from app.models.flower import Flower # NOQA
from app.models.song import Song # NOQA
from app.models.task import Task # NOQA
from app.models.statistics import Statistics # NOQA
from app.models.message import Message # NOQA
from app.models.registration import Registration # NOQA
return locals()
def start_shell():
try:
from IPython import start_ipython
start_ipython(argv=[], user_ns=load_user_ns())
except ImportError:
print "Install IPython to get it works."
else:
print "Interactive shell exit successfully."
if __name__ == '__main__':
start_shell()