rameshmoorthy commited on
Commit
928b16d
·
verified ·
1 Parent(s): 18d1282

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -152,14 +152,14 @@ def generate_report(file, type):
152
 
153
  return temp_file1.name ,temp_file3.name ,variable_table(df),dfviz,sd1
154
  def handle_click(file, sheet_name):
155
- sheet_dropdown.update(disabled=True) # Disable during report generation
156
  results = generate_report(file, sheet_name)
157
- sheet_dropdown.update(disabled=False) # Re-enable sheet selection
158
  return results
159
 
160
  def update_sheets(file):
161
  sheet_names = pd.ExcelFile(file).sheet_names
162
- sheet_dropdown.update(options=sheet_names, disabled=False)
163
 
164
  with gr.Blocks() as cluster:
165
  with gr.Column():
@@ -176,7 +176,7 @@ with gr.Blocks() as cluster:
176
  gr.HTML(value="""<h2 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h2>""")
177
  out2=gr.File(label="Download CSV")
178
  sheet_dropdown = gr.Dropdown(
179
- label="Select sheet", options=[], disabled=True # Initially disabled
180
  )
181
 
182
 
 
152
 
153
  return temp_file1.name ,temp_file3.name ,variable_table(df),dfviz,sd1
154
  def handle_click(file, sheet_name):
155
+ sheet_dropdown.update(visible=True) # Disable during report generation
156
  results = generate_report(file, sheet_name)
157
+ sheet_dropdown.update(visible=False) # Re-enable sheet selection
158
  return results
159
 
160
  def update_sheets(file):
161
  sheet_names = pd.ExcelFile(file).sheet_names
162
+ sheet_dropdown.update(choices=sheet_names, disabled=False)
163
 
164
  with gr.Blocks() as cluster:
165
  with gr.Column():
 
176
  gr.HTML(value="""<h2 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h2>""")
177
  out2=gr.File(label="Download CSV")
178
  sheet_dropdown = gr.Dropdown(
179
+ label="Select sheet", choices=[], visible=False # Initially disabled
180
  )
181
 
182