openfree commited on
Commit
dffb689
1 Parent(s): 78a7be3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -24,8 +24,11 @@ def get_all_spaces():
24
  if not spaces:
25
  return "No Spaces found."
26
 
27
- # Formatting Spaces into a grid
28
- space_info = [f"Name: {space['name']}\nSDK: {space['sdk']}\nStatus: {space['status']}" for space in spaces]
 
 
 
29
  return "\n\n".join(space_info)
30
 
31
  # Creating the Gradio interface
 
24
  if not spaces:
25
  return "No Spaces found."
26
 
27
+ # Formatting Spaces into a grid, handling missing keys with .get()
28
+ space_info = [
29
+ f"Name: {space.get('name', 'N/A')}\nSDK: {space.get('sdk', 'N/A')}\nStatus: {space.get('status', 'N/A')}"
30
+ for space in spaces
31
+ ]
32
  return "\n\n".join(space_info)
33
 
34
  # Creating the Gradio interface