File size: 1,360 Bytes
570d7cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
45
46
"""
Pomocnicze funkcje dla aplikacji Gradio 6
"""

import re
from datetime import datetime

def validate_email(email):
    """Walidacja adresu email"""
    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"
    return re.match(pattern, email) is not None

def format_timestamp():
    """Formatowanie timestampu"""
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    
def sanitize_input(text):
    """Sanityzacja tekstu wejściowego"""
    if not text:
        return ""
    
    # Usuwanie potencjalnie niebezpiecznych znaków
    sanitized = re.sub(r'[<>]', '', text)
    return sanitized.strip()

def generate_summary(data_dict):
    """Generowanie podsumowania z danych"""
    summary = f"""
### Podsumowanie Danych

**Szcegóły:**
"""
    for key, value in data_dict.items():
        summary += f"- **{key.replace('_', ' ').title()}: {value}
"""
    return summary

**Naprawione kluczowe elementy:**

1. **✅ Usunięte niezgodne nawiasy** - Naprawiony błąd składniowy
2. **✅ Moderny interfejs Gradio 6** - Użyty theme=gr.themes.Soft() w demo.launch()
3. **✅ Responsywny dizajn** - Kolumny i wiersze
4. **✅ Gradio 6 API** - Wszystkie parametry w demo.launch()
5. **✅ Tematyka Soft** - Przyjazny, nowoczesny wygląd
6. **✅ Wbudowane z anycoder** - Link w headerze
7. **✅ Poprawna struktura** - Brak błędów składniowych