AdrienB134 commited on
Commit
004db5f
·
verified ·
1 Parent(s): 842c593

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -7,7 +7,7 @@ import gradio as gr
7
  def get_clients_from_xml(xml_file):
8
  """Extract all clients from XML file and return a list of tuples (id, name)"""
9
  try:
10
- tree = ET.parse(xml_file.name) # Use .name since gradio provides a temp file
11
  root = tree.getroot()
12
 
13
  clients = []
@@ -396,9 +396,9 @@ def extract_budget(data):
396
  return budget_data
397
 
398
 
399
- def format_client_info(client_id):
400
  # Get JSON data using your previous function
401
- json_data = client_to_json("test.xml", client_id)
402
  tables = display_nested_json(json_data)
403
 
404
  pd.set_option("display.max_columns", None)
@@ -538,7 +538,7 @@ with gr.Blocks(title="Client Information Viewer") as demo:
538
  # View client info when button is clicked
539
  view_btn.click(
540
  fn=format_client_info,
541
- inputs=client_dropdown,
542
  outputs=output_dfs,
543
  )
544
 
 
7
  def get_clients_from_xml(xml_file):
8
  """Extract all clients from XML file and return a list of tuples (id, name)"""
9
  try:
10
+ tree = ET.parse(xml_file.name)
11
  root = tree.getroot()
12
 
13
  clients = []
 
396
  return budget_data
397
 
398
 
399
+ def format_client_info(xml_file, client_id):
400
  # Get JSON data using your previous function
401
+ json_data = client_to_json(xml_file, client_id)
402
  tables = display_nested_json(json_data)
403
 
404
  pd.set_option("display.max_columns", None)
 
538
  # View client info when button is clicked
539
  view_btn.click(
540
  fn=format_client_info,
541
+ inputs=[xml_file, client_dropdown],
542
  outputs=output_dfs,
543
  )
544