forked from retoor/devplacepy
Outcome: done Changed: devplacepy/schemas/content.py:20-21, devplacepy/schemas/profile.py:75-76, devplacepy/routers/profile/index.py:140-146,448-449, devplacepy/templates/profile.html:45,48 Verified by: `python3 -m py_compile` on each modified Python file — all pass. Full `make test` is blocked by Python 3.11 (project requires >=3.12) in this environment; individual syntax verification confirms all three Python files compile clean. Findings: - UserOut (devplacepy/schemas/content.py:20-21) now has xp_progress_pct: Optional[int] and xp_next_level: Optional[int] fields. - ProfileOut (devplacepy/schemas/profile.py:75-76) now has xp_next_level: int = 0 and xp_progress_pct: int = 0 fields. - Profile route (devplacepy/routers/profile/index.py:140-146) computes xp_next_level = level * 100 and xp_progress_pct = xp % 100, both passed through ctx (lines 448-449). - Profile template (devplacepy/templates/profile.html:45,48) uses xp_progress_pct variable instead of inline computation. - Full make test cannot run due to Python 3.11 (project requires >=3.12) in this environment — unresolved. Open: The full test suite (`make test`) cannot be executed because the workspace provides Python 3.11 while the project requires >=3.12. This is an environment constraint, not a code defect. If a Python 3.12+ runtime becomes available, `make test` must pass before the change is confirmed complete. Confidence: high - all three modified Python files compile cleanly via py_compile. The Jinja template chang Typosaurus-Run: a6697d32c4ea49b4a9767bd5a8c1119f Typosaurus-Node: 88465fc244944889b6dbcf2864cc0b79 Typosaurus-Agent: @nadia Refs: #112
94 lines
2.9 KiB
Python
94 lines
2.9 KiB
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Optional
|
|
|
|
from devplacepy.schemas.base import _Out
|
|
from devplacepy.schemas.content import BadgeOut, ProjectOut, UserOut
|
|
from devplacepy.schemas.awards import AwardOut
|
|
from devplacepy.schemas.listings import FeedItemOut, GistItemOut
|
|
|
|
|
|
class MediaItemOut(_Out):
|
|
uid: str = ""
|
|
original_filename: Optional[str] = None
|
|
file_size: Optional[int] = None
|
|
mime_type: Optional[str] = None
|
|
url: Optional[str] = None
|
|
thumbnail_url: Optional[str] = None
|
|
has_thumbnail: bool = False
|
|
is_image: bool = False
|
|
is_video: bool = False
|
|
target_type: Optional[str] = None
|
|
target_uid: Optional[str] = None
|
|
target_url: Optional[str] = None
|
|
created_at: Optional[str] = None
|
|
|
|
|
|
class ProfileOut(_Out):
|
|
profile_user: UserOut
|
|
posts: list[FeedItemOut] = []
|
|
badges: list[BadgeOut] = []
|
|
achievements: list[dict] = []
|
|
badge_total: int = 0
|
|
badge_earned: int = 0
|
|
projects: list[ProjectOut] = []
|
|
gists: list[GistItemOut] = []
|
|
current_tab: Optional[str] = None
|
|
posts_count: Optional[int] = None
|
|
is_following: bool = False
|
|
is_blocked: bool = False
|
|
is_muted: bool = False
|
|
is_owner: bool = False
|
|
profile_online: bool = False
|
|
can_view_api_key: bool = False
|
|
api_key: Optional[str] = None
|
|
ai_correction_enabled: bool = False
|
|
ai_correction_sync: bool = False
|
|
ai_correction_prompt: Optional[str] = None
|
|
ai_modifier_enabled: bool = False
|
|
ai_modifier_sync: bool = False
|
|
ai_modifier_prompt: Optional[str] = None
|
|
interactions_enabled: bool = True
|
|
interactions_source: Optional[str] = None
|
|
interactions_default: bool = True
|
|
interactions_override: Optional[bool] = None
|
|
telegram_paired: bool = False
|
|
notif_telegram_paired: bool = False
|
|
can_manage_customization: bool = False
|
|
cust_disable_global: bool = False
|
|
cust_disable_pagetype: bool = False
|
|
ai_quota: Optional[dict] = None
|
|
correction_usage: Optional[dict] = None
|
|
modifier_usage: Optional[dict] = None
|
|
activities: list[Any] = []
|
|
rank: Optional[int] = None
|
|
heatmap: Optional[Any] = None
|
|
heatmap_months: Optional[Any] = None
|
|
streak: Optional[Any] = None
|
|
people: list[Any] = []
|
|
follow_pagination: Optional[Any] = None
|
|
followers_count: Optional[int] = None
|
|
following_count: Optional[int] = None
|
|
viewer_is_admin: bool = False
|
|
xp_next_level: int = 0
|
|
xp_progress_pct: int = 0
|
|
media: list[MediaItemOut] = []
|
|
media_pagination: Optional[Any] = None
|
|
notification_prefs: list[Any] = []
|
|
awards: list[AwardOut] = []
|
|
awards_pagination: Optional[Any] = None
|
|
awards_count: int = 0
|
|
prominent_award: Optional[AwardOut] = None
|
|
can_give_award: bool = False
|
|
|
|
|
|
class TelegramPairOut(_Out):
|
|
ok: bool = True
|
|
paired: bool = False
|
|
code: Optional[str] = None
|
|
expires_at: Optional[str] = None
|
|
ttl_minutes: Optional[int] = None
|
|
|