Omnibus commited on
Commit
25fe461
1 Parent(s): 15a31ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -204,7 +204,8 @@ def save_game(name,score,background_img,star_img,enemy_img,platform_img,dude_img
204
  except Exception as e:
205
  print (e)
206
  return f'Error Saving Game: {e}'
207
- block = {'game_name': game,
 
208
  'timestamp': timestamp,
209
  'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
210
  'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
@@ -213,9 +214,9 @@ def save_game(name,score,background_img,star_img,enemy_img,platform_img,dude_img
213
  #'dude_url': f'https://huggingface.co/datasets/{repo}/{space}/raw/main/{dude_img}',
214
  }
215
  print(block)
216
- lod.append(block)
217
 
218
- json_object = json.dumps(lod, indent=4)
219
  with open("tmp2.json", "w") as outfile:
220
  outfile.write(json_object)
221
  try:
@@ -279,7 +280,7 @@ with gr.Blocks() as app:
279
  url_params=gr.Textbox()
280
  with gr.Row():
281
  text_input=gr.Textbox()
282
- url_params=gr.Textbox()
283
  acc=gr.Textbox()
284
  def return_score(text):
285
  return text
 
204
  except Exception as e:
205
  print (e)
206
  return f'Error Saving Game: {e}'
207
+ game_box=[]
208
+ block2 = {'game_name': game,
209
  'timestamp': timestamp,
210
  'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
211
  'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
 
214
  #'dude_url': f'https://huggingface.co/datasets/{repo}/{space}/raw/main/{dude_img}',
215
  }
216
  print(block)
217
+ game_box.append(block2)
218
 
219
+ json_object = json.dumps(game_box, indent=4)
220
  with open("tmp2.json", "w") as outfile:
221
  outfile.write(json_object)
222
  try:
 
280
  url_params=gr.Textbox()
281
  with gr.Row():
282
  text_input=gr.Textbox()
283
+ url_params = gr.JSON({}, visible=True, label="")
284
  acc=gr.Textbox()
285
  def return_score(text):
286
  return text