Update app.py
Browse files
app.py
CHANGED
|
@@ -196,7 +196,7 @@ with gr.Blocks() as demo:
|
|
| 196 |
|
| 197 |
run_button = gr.Button("Run Query")
|
| 198 |
|
| 199 |
-
def update_topic_content(topic_name:str)-> Tuple[Any, Dict[str, str], str]:
|
| 200 |
"""
|
| 201 |
Given a topic name, updates the UI dropdown choices with the corresponding content,
|
| 202 |
and returns the content dictionary (what content is available under given topic_name) and internal topic code (ID of the topic_name).
|
|
@@ -214,7 +214,7 @@ with gr.Blocks() as demo:
|
|
| 214 |
content_dict = get_topic_content(topic_code)
|
| 215 |
return gr.update(choices=list(content_dict.keys()), visible=True), content_dict, topic_code
|
| 216 |
|
| 217 |
-
def update_reports(topic_content_name:str, content_dict:dict = None, topic_name:str='')-> Tuple[Dict[str, str], str, Any]:
|
| 218 |
"""
|
| 219 |
Updates the UI dropdown menu with available report titles for a selected topic content,
|
| 220 |
and returns the titles dictionary and the corresponding content code.
|
|
@@ -248,7 +248,7 @@ with gr.Blocks() as demo:
|
|
| 248 |
titles_dict = get_titles(topic_content_code)
|
| 249 |
return titles_dict, topic_content_code, gr.update(choices=list(titles_dict.keys()), visible=True)
|
| 250 |
|
| 251 |
-
def update_topic_params_and_link(report_title:str, titles_dict:str)-> Tuple[str, Any, Any]:
|
| 252 |
"""
|
| 253 |
Prepares and returns metadata, a hyperlink, and query parameter preview for a selected report
|
| 254 |
from the Official Statistics Portal of Latvia (CSP).
|
|
|
|
| 196 |
|
| 197 |
run_button = gr.Button("Run Query")
|
| 198 |
|
| 199 |
+
def update_topic_content(topic_name: str)-> Tuple[Any, Dict[str, str], str]:
|
| 200 |
"""
|
| 201 |
Given a topic name, updates the UI dropdown choices with the corresponding content,
|
| 202 |
and returns the content dictionary (what content is available under given topic_name) and internal topic code (ID of the topic_name).
|
|
|
|
| 214 |
content_dict = get_topic_content(topic_code)
|
| 215 |
return gr.update(choices=list(content_dict.keys()), visible=True), content_dict, topic_code
|
| 216 |
|
| 217 |
+
def update_reports(topic_content_name: str, content_dict: dict = None, topic_name: str = '')-> Tuple[Dict[str, str], str, Any]:
|
| 218 |
"""
|
| 219 |
Updates the UI dropdown menu with available report titles for a selected topic content,
|
| 220 |
and returns the titles dictionary and the corresponding content code.
|
|
|
|
| 248 |
titles_dict = get_titles(topic_content_code)
|
| 249 |
return titles_dict, topic_content_code, gr.update(choices=list(titles_dict.keys()), visible=True)
|
| 250 |
|
| 251 |
+
def update_topic_params_and_link(report_title: str, titles_dict: str)-> Tuple[str, Any, Any]:
|
| 252 |
"""
|
| 253 |
Prepares and returns metadata, a hyperlink, and query parameter preview for a selected report
|
| 254 |
from the Official Statistics Portal of Latvia (CSP).
|