VyLala commited on
Commit
40993b9
Β·
verified Β·
1 Parent(s): 4845cbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -289,8 +289,6 @@ with gr.Blocks() as interface:
289
  tmp_dir = tempfile.mkdtemp()
290
  output_file_path = os.path.join(tmp_dir, "batch_output_live.xlsx")
291
  limited_acc = 50 + (0 if email.strip() else 0)
292
- if not email.strip():
293
- output_file_path = "Write your email so that you can download the outputs."
294
  # Step 1: Parse input
295
  accessions, error = extract_accessions_from_input(file, text)
296
  print("πŸ§ͺ Accessions received:", accessions)
@@ -316,7 +314,9 @@ with gr.Blocks() as interface:
316
  processed_accessions = 0 # βœ… track successful accessions
317
  email_tracked = False
318
  log_lines = []
319
-
 
 
320
  # Step 2: Loop through accessions
321
  for i, acc in enumerate(accessions):
322
  if global_stop_flag.value:
@@ -335,7 +335,8 @@ with gr.Blocks() as interface:
335
  yield (
336
  make_html_table(all_rows),
337
  gr.update(visible=True),
338
- gr.update(value=output_file_path, visible=True),
 
339
  gr.update(value=usage_text, visible=True),
340
  "πŸ›‘ Stopped",
341
  "\n".join(log_lines)
@@ -386,7 +387,8 @@ with gr.Blocks() as interface:
386
  yield (
387
  make_html_table(all_rows),
388
  gr.update(visible=True),
389
- gr.update(value=output_file_path, visible=True),
 
390
  gr.update(value=usage_text, visible=True),
391
  "βœ… Done",
392
  "\n".join(log_lines)
 
289
  tmp_dir = tempfile.mkdtemp()
290
  output_file_path = os.path.join(tmp_dir, "batch_output_live.xlsx")
291
  limited_acc = 50 + (0 if email.strip() else 0)
 
 
292
  # Step 1: Parse input
293
  accessions, error = extract_accessions_from_input(file, text)
294
  print("πŸ§ͺ Accessions received:", accessions)
 
314
  processed_accessions = 0 # βœ… track successful accessions
315
  email_tracked = False
316
  log_lines = []
317
+ if not email.strip():
318
+ output_file_path = None#"Write your email so that you can download the outputs."
319
+ log_lines.append("πŸ“₯ Provide your email to receive a downloadable Excel report.")
320
  # Step 2: Loop through accessions
321
  for i, acc in enumerate(accessions):
322
  if global_stop_flag.value:
 
335
  yield (
336
  make_html_table(all_rows),
337
  gr.update(visible=True),
338
+ #gr.update(value=output_file_path, visible=True),
339
+ gr.update(value=output_file_path, visible=bool(output_file_path)),
340
  gr.update(value=usage_text, visible=True),
341
  "πŸ›‘ Stopped",
342
  "\n".join(log_lines)
 
387
  yield (
388
  make_html_table(all_rows),
389
  gr.update(visible=True),
390
+ #gr.update(value=output_file_path, visible=True),
391
+ gr.update(value=output_file_path, visible=bool(output_file_path)),
392
  gr.update(value=usage_text, visible=True),
393
  "βœ… Done",
394
  "\n".join(log_lines)