Update app.py
Browse files
app.py
CHANGED
|
@@ -200,7 +200,7 @@ class AllSessions():
|
|
| 200 |
all_sesh = AllSessions()
|
| 201 |
|
| 202 |
def getSesh(seshid):
|
| 203 |
-
if seshid not in all_sesh.sessions:
|
| 204 |
all_sesh.sessions[seshid] = Session()
|
| 205 |
all_sesh.sessions[seshid].seshid = seshid
|
| 206 |
sesh = all_sesh.sessions[seshid]
|
|
@@ -216,10 +216,9 @@ Palette_img = np.zeros((200,200,3)).astype(np.uint8)
|
|
| 216 |
Palette_img[:] = 128
|
| 217 |
|
| 218 |
def submitPhoto(img, rooms, seshid):
|
| 219 |
-
print('submitPhoto reset rooms: ', rooms, seshid)
|
| 220 |
seshid = str(time.time()) if not seshid or seshid == 'SESHID' else seshid
|
| 221 |
sesh = getSesh(seshid)
|
| 222 |
-
|
| 223 |
sesh.current_img_signature = str(img.sum())
|
| 224 |
sesh.img_data[sesh.current_img_signature] = img
|
| 225 |
sesh.Palettes[sesh.current_img_signature] = {}
|
|
|
|
| 200 |
all_sesh = AllSessions()
|
| 201 |
|
| 202 |
def getSesh(seshid):
|
| 203 |
+
if seshid and seshid not in all_sesh.sessions:
|
| 204 |
all_sesh.sessions[seshid] = Session()
|
| 205 |
all_sesh.sessions[seshid].seshid = seshid
|
| 206 |
sesh = all_sesh.sessions[seshid]
|
|
|
|
| 216 |
Palette_img[:] = 128
|
| 217 |
|
| 218 |
def submitPhoto(img, rooms, seshid):
|
|
|
|
| 219 |
seshid = str(time.time()) if not seshid or seshid == 'SESHID' else seshid
|
| 220 |
sesh = getSesh(seshid)
|
| 221 |
+
print('submitPhoto reset rooms: ', rooms, seshid, sesh.seshid)
|
| 222 |
sesh.current_img_signature = str(img.sum())
|
| 223 |
sesh.img_data[sesh.current_img_signature] = img
|
| 224 |
sesh.Palettes[sesh.current_img_signature] = {}
|