forked from vpython/glowscript
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
20 lines (12 loc) · 685 Bytes
/
Copy pathmain.py
File metadata and controls
20 lines (12 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from ide import app, models, routes, modDBFunctions
from google.cloud import ndb
@app.shell_context_processor
def make_shell_context():
project = routes.emulator and 'glowscript-dev' or None # use a fake project for local dev.
client = ndb.Client(project=project) # for user data, folders, and programs
def wc(func, **args):
with client.context():
func(**args)
return {'app': app, 'User': models.User, 'Folder':models.Folder, 'Program':models.Program, 'Setting':models.Setting,
'ndb':ndb, 'wc':wc, 'models':models, 'routes':routes,
'project':project, 'client':client, 'modDBFunctions':modDBFunctions}