Spaces:
Running
Running
File size: 1,169 Bytes
0ad7e2a 89bbef2 0ad7e2a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
"""
Base class for UI tabs
"""
import gradio as gr
import logging
from typing import Dict, Any, Optional
logger = logging.getLogger(__name__)
class BaseTab:
"""Base class for UI tabs with common functionality"""
def __init__(self, app_state):
"""Initialize the tab with app state reference
Args:
app_state: Reference to main AppUI instance
"""
self.app = app_state
self.components = {}
def create(self, parent=None) -> gr.TabItem:
"""Create the tab UI components
Args:
parent: Optional parent container
Returns:
The created tab component
"""
raise NotImplementedError("Subclasses must implement create()")
def connect_events(self) -> None:
"""Connect event handlers to UI components"""
raise NotImplementedError("Subclasses must implement connect_events()")
def refresh(self) -> Dict[str, Any]:
"""Refresh UI components with current data
Returns:
Dictionary with updated values for components
"""
return {} |