28 lines
507 B
Python
28 lines
507 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Simple test to debug Ritz framework
|
|
"""
|
|
|
|
from framework import (
|
|
component, signal,
|
|
Main, Div, P, Button, H1
|
|
)
|
|
|
|
@component
|
|
def SimpleTest():
|
|
"""Simplest possible test"""
|
|
with Main():
|
|
yield P('Hello World')
|
|
|
|
# Test it
|
|
import json
|
|
|
|
result = SimpleTest()
|
|
print("Result type:", type(result))
|
|
print("Result:", result)
|
|
|
|
if result:
|
|
print("\n=== HTML ===")
|
|
print(result.to_html())
|
|
print("\n=== IR ===")
|
|
print(json.dumps(result.to_ir(), indent=2)) |