Ramesh-vani commited on
Commit
1bf7cc6
·
verified ·
1 Parent(s): 9f13dba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,7 +21,7 @@ async def create_file_structure(websocket, data, base_path='.'):
21
  folder_path = os.path.join(base_path, data['name'])
22
  os.makedirs(folder_path, exist_ok=True)
23
  for child in data['children']:
24
- await create_file_structure(child, base_path=folder_path)
25
  elif data['type'] == 'file':
26
  file_path = os.path.join(base_path, data['name'])
27
  with open(file_path, 'w', encoding='utf-8') as file:
@@ -131,7 +131,7 @@ async def start(websocket,events):
131
  js = json.loads(events)
132
  assert js["type"] == "init"
133
  base_path = os.path.join(os.getcwd(), 'projects', js["project_name"])
134
- data=js["file_structure"]
135
  # Receive and process moves from the first player.
136
  # await play(websocket, game, PLAYER1, connected)
137
  await create_file_structure(websocket,data, base_path=base_path)
 
21
  folder_path = os.path.join(base_path, data['name'])
22
  os.makedirs(folder_path, exist_ok=True)
23
  for child in data['children']:
24
+ create_file_structure(child, base_path=folder_path)
25
  elif data['type'] == 'file':
26
  file_path = os.path.join(base_path, data['name'])
27
  with open(file_path, 'w', encoding='utf-8') as file:
 
131
  js = json.loads(events)
132
  assert js["type"] == "init"
133
  base_path = os.path.join(os.getcwd(), 'projects', js["project_name"])
134
+ data=json.loads(js["file_structure"])
135
  # Receive and process moves from the first player.
136
  # await play(websocket, game, PLAYER1, connected)
137
  await create_file_structure(websocket,data, base_path=base_path)