forked from pmeinhardt/tlr
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconsole.py
More file actions
executable file
·37 lines (24 loc) · 814 Bytes
/
console.py
File metadata and controls
executable file
·37 lines (24 loc) · 814 Bytes
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
#!/usr/bin/env python
# Load application environment and initialize models
from database import MDB as Database
from config import settings, dbconf, bsconf
from models import *
import models
database = Database(**dbconf)
blobstore = None # Blobstore(bsconf.nodes, **bsconf.opts)
models.initialize(database, blobstore)
# Drop into IPython
from IPython import embed
from IPython import Config
config = Config()
prompt = config.PromptManager
prompt.in_template = ">>> "
prompt.in2_template = "... "
prompt.out_template = ""
prompt.justify = False
ishell = config.InteractiveShell
ishell.confirm_exit = False
mode = ("debug" if settings["debug"] else "default")
banner = "Loaded %s environment\nType %%quickref for help" % mode
del prompt, ishell # clean up namespace
embed(config=config, banner1=banner)