Update pages/__init__.py
Browse files- pages/__init__.py +34 -4
pages/__init__.py
CHANGED
|
@@ -1,8 +1,38 @@
|
|
| 1 |
"""
|
| 2 |
-
Pages
|
| 3 |
-
Contains all page components and dashboard functionality
|
| 4 |
"""
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""
|
| 2 |
+
Pages package initialization
|
|
|
|
| 3 |
"""
|
| 4 |
|
| 5 |
+
# Import all page creation functions
|
| 6 |
+
try:
|
| 7 |
+
from pages.dashboard import create_dashboard_page
|
| 8 |
+
except ImportError as e:
|
| 9 |
+
print(f"Warning: Could not import dashboard page: {e}")
|
| 10 |
+
create_dashboard_page = None
|
| 11 |
|
| 12 |
+
# You can add more page imports here as needed
|
| 13 |
+
# from pages.analytics import create_analytics_page
|
| 14 |
+
# from pages.settings import create_settings_page
|
| 15 |
+
# from pages.profile import create_profile_page
|
| 16 |
+
|
| 17 |
+
__all__ = [
|
| 18 |
+
'create_dashboard_page',
|
| 19 |
+
# Add other page functions here
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
# Optional: Create a page registry for dynamic loading
|
| 23 |
+
PAGE_REGISTRY = {
|
| 24 |
+
'dashboard': create_dashboard_page,
|
| 25 |
+
# Add other pages here
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
def get_page_function(page_name):
|
| 29 |
+
"""
|
| 30 |
+
Get page function by name
|
| 31 |
+
"""
|
| 32 |
+
return PAGE_REGISTRY.get(page_name)
|
| 33 |
+
|
| 34 |
+
def list_available_pages():
|
| 35 |
+
"""
|
| 36 |
+
List all available pages
|
| 37 |
+
"""
|
| 38 |
+
return list(PAGE_REGISTRY.keys())
|