WebashalarForML commited on
Commit
023e864
·
verified ·
1 Parent(s): a8d1c3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -2146,11 +2146,12 @@ def create_sb3_archive(project_folder, project_id):
2146
  # output_filename = os.path.join("outputs", project_id)
2147
  #output_filename = OUTPUT_DIR / project_id
2148
  output_filename = GEN_PROJECT_DIR / project_id
 
2149
  zip_path = None
2150
  sb3_path = None
2151
  try:
2152
  zip_path = shutil.make_archive(output_filename, 'zip', root_dir=project_folder)
2153
- print(" --------------------------------------- zip_path_str ---------------------------------------", output_base_name, project_folder)
2154
  logger.info(f"Project folder zipped to: {zip_path}")
2155
 
2156
  # 2. Rename the .zip file to .sb3
@@ -2180,8 +2181,9 @@ def download_sb3(project_id):
2180
  Allows users to download the generated .sb3 Scratch project file.
2181
  """
2182
  sb3_filename = f"{project_id}.sb3"
2183
- sb3_filepath = os.path.join("generated_projects", sb3_filename)
2184
-
 
2185
  try:
2186
  if os.path.exists(sb3_filepath):
2187
  logger.info(f"Serving SB3 file for project ID: {project_id}")
 
2146
  # output_filename = os.path.join("outputs", project_id)
2147
  #output_filename = OUTPUT_DIR / project_id
2148
  output_filename = GEN_PROJECT_DIR / project_id
2149
+ print(" --------------------------------------- output_filename ---------------------------------------",output_filename)
2150
  zip_path = None
2151
  sb3_path = None
2152
  try:
2153
  zip_path = shutil.make_archive(output_filename, 'zip', root_dir=project_folder)
2154
+ print(" --------------------------------------- zip_path_str ---------------------------------------", output_filename, project_folder)
2155
  logger.info(f"Project folder zipped to: {zip_path}")
2156
 
2157
  # 2. Rename the .zip file to .sb3
 
2181
  Allows users to download the generated .sb3 Scratch project file.
2182
  """
2183
  sb3_filename = f"{project_id}.sb3"
2184
+ #sb3_filepath = os.path.join("generated_projects", sb3_filename)
2185
+ sb3_filepath = GEN_PROJECT_DIR / sb3_filename
2186
+
2187
  try:
2188
  if os.path.exists(sb3_filepath):
2189
  logger.info(f"Serving SB3 file for project ID: {project_id}")