-
Notifications
You must be signed in to change notification settings - Fork 0
/
image-handler.py
46 lines (30 loc) · 934 Bytes
/
image-handler.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
43
44
45
46
import cherrypy
from cherrypy.lib.static import serve_file
import os.path
import json
import sys
#our files
import db
worldData = {}
userData = None
worldId = 1
current_dir = os.path.dirname(os.path.abspath(__file__))
voidImagePath = os.path.join(current_dir, 'img-src', 'void.png')
class Main:
def index(self):
out = ""
out += "Hello world!<br>"
out += sys.version + "<br>"
out += json.dumps(['foo', {'var': ('baz', None, 1.0, 2)}])
return out
index.exposed = True
def worldmap(self, x = None, y = None, z = None):
if x == None or y == None or z == None:
return serve_file(voidImagePath, 'image/png')
c = db.levelData.columns
row = db.selectOne([c.userId, c.userName, c.userX, c.userY, c.userZ], c.userId == userId)
worldmap.exposed = True
if __name__=='__main__':
cherrypy.config.update({'environment': 'production',
'log.screen': False,})
cherrypy.quickstart(Main())