Update app.py
Browse files
app.py
CHANGED
|
@@ -1182,7 +1182,7 @@ def loadColorAndCharacter(text, seshid):
|
|
| 1182 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=3))
|
| 1183 |
print('dump_text_gen: ', responses)"""
|
| 1184 |
|
| 1185 |
-
dummy = dummy_
|
| 1186 |
|
| 1187 |
print('sesh.display_items_[sesh.current_img_signature]: ', sesh.display_items_[sesh.current_img_signature])
|
| 1188 |
print('item_data_: ', [(k,len(v)) for k,v in sesh.item_data_[sesh.current_img_signature][sesh.room_type][sesh.room_style][sesh.price][sesh.Palette_ids[sesh.current_img_signature]].items() if k not in ['Palette', 'Living Room', 'Bedroom']])
|
|
@@ -1194,13 +1194,13 @@ def loadColorAndCharacter(text, seshid):
|
|
| 1194 |
valid_data = {'gen_uid': sesh.gen_uid, 'item_locator_data': item_locator_data, 'product_pd_counts': sesh.product_pd_counts, 'responses':[r.decode('ISO-8859-1') if type(r) != type(None) else r for r in sesh.responses]}
|
| 1195 |
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
| 1196 |
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 1197 |
-
jsondata = json.loads(r.content)
|
| 1198 |
"""urls = ['https://dreamdemo.pythonanywhere.com/script_gen' for _ in range(len(sesh.product_pd_counts))]
|
| 1199 |
headers = [{'Content-type': 'application/json', 'Accept': 'text/plain'} for i,_ in enumerate(urls)]
|
| 1200 |
json_data = [json.dumps({'room_type': sesh.room_type, 'idx': i, 'gen_uid': sesh.gen_uid}) for i in range(len(sesh.product_pd_counts))]
|
| 1201 |
responses = asyncio.run(main_post(urls, headers, json_data))"""
|
| 1202 |
#sesh.found_terms_4_room_items = jsondata['response']
|
| 1203 |
-
print('loadColorAndCharacter: ', jsondata['response'])
|
| 1204 |
|
| 1205 |
|
| 1206 |
urls = ['https://dreamdemo.pythonanywhere.com/script_gen' for _ in range(1)]
|
|
@@ -1219,7 +1219,7 @@ def loadColorAndCharacter(text, seshid):
|
|
| 1219 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=1))
|
| 1220 |
except:
|
| 1221 |
pass
|
| 1222 |
-
setSesh(seshid, sesh)
|
| 1223 |
return 'loaded'
|
| 1224 |
else:
|
| 1225 |
setSesh(seshid, sesh)
|
|
|
|
| 1182 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=3))
|
| 1183 |
print('dump_text_gen: ', responses)"""
|
| 1184 |
|
| 1185 |
+
"""dummy = dummy_
|
| 1186 |
|
| 1187 |
print('sesh.display_items_[sesh.current_img_signature]: ', sesh.display_items_[sesh.current_img_signature])
|
| 1188 |
print('item_data_: ', [(k,len(v)) for k,v in sesh.item_data_[sesh.current_img_signature][sesh.room_type][sesh.room_style][sesh.price][sesh.Palette_ids[sesh.current_img_signature]].items() if k not in ['Palette', 'Living Room', 'Bedroom']])
|
|
|
|
| 1194 |
valid_data = {'gen_uid': sesh.gen_uid, 'item_locator_data': item_locator_data, 'product_pd_counts': sesh.product_pd_counts, 'responses':[r.decode('ISO-8859-1') if type(r) != type(None) else r for r in sesh.responses]}
|
| 1195 |
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
| 1196 |
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 1197 |
+
jsondata = json.loads(r.content)"""
|
| 1198 |
"""urls = ['https://dreamdemo.pythonanywhere.com/script_gen' for _ in range(len(sesh.product_pd_counts))]
|
| 1199 |
headers = [{'Content-type': 'application/json', 'Accept': 'text/plain'} for i,_ in enumerate(urls)]
|
| 1200 |
json_data = [json.dumps({'room_type': sesh.room_type, 'idx': i, 'gen_uid': sesh.gen_uid}) for i in range(len(sesh.product_pd_counts))]
|
| 1201 |
responses = asyncio.run(main_post(urls, headers, json_data))"""
|
| 1202 |
#sesh.found_terms_4_room_items = jsondata['response']
|
| 1203 |
+
"""print('loadColorAndCharacter: ', jsondata['response'])
|
| 1204 |
|
| 1205 |
|
| 1206 |
urls = ['https://dreamdemo.pythonanywhere.com/script_gen' for _ in range(1)]
|
|
|
|
| 1219 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=1))
|
| 1220 |
except:
|
| 1221 |
pass
|
| 1222 |
+
setSesh(seshid, sesh)"""
|
| 1223 |
return 'loaded'
|
| 1224 |
else:
|
| 1225 |
setSesh(seshid, sesh)
|