Simplify UI layout API by removing pre_render()
This commit is contained in:
parent
786a50b90a
commit
0224fd9861
@ -25,7 +25,6 @@ UI_LAYOUT_MODULES : List[ModuleType] = []
|
|||||||
UI_LAYOUT_METHODS =\
|
UI_LAYOUT_METHODS =\
|
||||||
[
|
[
|
||||||
'pre_check',
|
'pre_check',
|
||||||
'pre_render',
|
|
||||||
'render',
|
'render',
|
||||||
'listen',
|
'listen',
|
||||||
'run'
|
'run'
|
||||||
@ -83,7 +82,7 @@ def launch() -> None:
|
|||||||
with gradio.Blocks(theme = get_theme(), css = get_css(), title = metadata.get('name') + ' ' + metadata.get('version'), fill_width = True) as ui:
|
with gradio.Blocks(theme = get_theme(), css = get_css(), title = metadata.get('name') + ' ' + metadata.get('version'), fill_width = True) as ui:
|
||||||
for ui_layout in state_manager.get_item('ui_layouts'):
|
for ui_layout in state_manager.get_item('ui_layouts'):
|
||||||
ui_layout_module = load_ui_layout_module(ui_layout)
|
ui_layout_module = load_ui_layout_module(ui_layout)
|
||||||
if ui_layout_module.pre_render():
|
|
||||||
if ui_layouts_total > 1:
|
if ui_layouts_total > 1:
|
||||||
with gradio.Tab(ui_layout):
|
with gradio.Tab(ui_layout):
|
||||||
ui_layout_module.render()
|
ui_layout_module.render()
|
||||||
|
@ -23,10 +23,6 @@ def pre_check() -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def pre_render() -> bool:
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def render() -> gradio.Blocks:
|
def render() -> gradio.Blocks:
|
||||||
with gradio.Blocks() as layout:
|
with gradio.Blocks() as layout:
|
||||||
with gradio.Row():
|
with gradio.Row():
|
||||||
|
@ -8,10 +8,6 @@ def pre_check() -> bool:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def pre_render() -> bool:
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def render() -> gradio.Blocks:
|
def render() -> gradio.Blocks:
|
||||||
with gradio.Blocks() as layout:
|
with gradio.Blocks() as layout:
|
||||||
with gradio.Row():
|
with gradio.Row():
|
||||||
|
@ -8,10 +8,6 @@ def pre_check() -> bool:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def pre_render() -> bool:
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def render() -> gradio.Blocks:
|
def render() -> gradio.Blocks:
|
||||||
with gradio.Blocks() as layout:
|
with gradio.Blocks() as layout:
|
||||||
with gradio.Row():
|
with gradio.Row():
|
||||||
|
@ -8,10 +8,6 @@ def pre_check() -> bool:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def pre_render() -> bool:
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def render() -> gradio.Blocks:
|
def render() -> gradio.Blocks:
|
||||||
with gradio.Blocks() as layout:
|
with gradio.Blocks() as layout:
|
||||||
with gradio.Row():
|
with gradio.Row():
|
||||||
|
Loading…
Reference in New Issue
Block a user