mirror of
https://github.com/Death916/deathclock.git
synced 2026-04-10 03:04:40 -07:00
catchup
This commit is contained in:
parent
c8fb94ff33
commit
a1b15b86aa
13 changed files with 0 additions and 18 deletions
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
README.rst
Normal file → Executable file
0
README.rst
Normal file → Executable file
0
assets/favicon.ico
Normal file → Executable file
0
assets/favicon.ico
Normal file → Executable file
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
0
deathclock/__init__.py
Normal file → Executable file
0
deathclock/__init__.py
Normal file → Executable file
0
deathclock/deathclock.py
Normal file → Executable file
0
deathclock/deathclock.py
Normal file → Executable file
0
feeds.txt
Normal file → Executable file
0
feeds.txt
Normal file → Executable file
0
pyproject.toml
Normal file → Executable file
0
pyproject.toml
Normal file → Executable file
0
rxconfig.py
Normal file → Executable file
0
rxconfig.py
Normal file → Executable file
0
utils/alarm.py
Normal file → Executable file
0
utils/alarm.py
Normal file → Executable file
0
utils/news.py
Normal file → Executable file
0
utils/news.py
Normal file → Executable file
18
utils/scores.py
Normal file → Executable file
18
utils/scores.py
Normal file → Executable file
|
|
@ -8,14 +8,6 @@ import logging # Use logging for consistency
|
|||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
|
||||
class NBAScores(rx.Base):
|
||||
# Declare attributes at the class level for rx.Base/Pydantic
|
||||
# These aren't strictly necessary if the class is just a utility
|
||||
# providing methods, but it aligns with rx.Base inheritance.
|
||||
# If they were meant to hold state managed by Reflex, they'd be crucial.
|
||||
# For now, we can remove them or keep them empty if needed later.
|
||||
# Let's remove __init__ as it's not needed for this structure.
|
||||
|
||||
# No __init__ needed
|
||||
|
||||
async def get_scores(self): # Make async to match usage in State
|
||||
"""Fetches NBA scores and returns them as a list of dicts."""
|
||||
|
|
@ -59,19 +51,10 @@ class NBAScores(rx.Base):
|
|||
return [] # Return empty list on error
|
||||
|
||||
class mlbScores(rx.Base):
|
||||
# Declare attributes at the class level if needed by rx.Base/Pydantic
|
||||
# _scores: list = [] # Not strictly needed for utility methods
|
||||
# _games: list = [] # Not strictly needed for utility methods
|
||||
|
||||
# No __init__ needed
|
||||
|
||||
async def get_games(self): # Make async
|
||||
"""Fetches MLB games data."""
|
||||
try:
|
||||
# statsapi might be blocking, consider running in thread executor for async context
|
||||
# For simplicity now, we call it directly.
|
||||
# If statsapi has async methods, use those. Otherwise, wrap sync calls:
|
||||
# games = await rx.call_blocking(statsapi.schedule)
|
||||
games = statsapi.schedule() # Assuming sync for now
|
||||
return games
|
||||
except Exception as e:
|
||||
|
|
@ -103,7 +86,6 @@ class mlbScores(rx.Base):
|
|||
return scores_list # RETURN THE LIST
|
||||
|
||||
# Keep the __main__ block for testing if desired, but update calls to be async if needed
|
||||
# (e.g., using asyncio.run())
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
|
||||
|
|
|
|||
0
utils/weather.py
Normal file → Executable file
0
utils/weather.py
Normal file → Executable file
0
uv.lock
generated
Normal file → Executable file
0
uv.lock
generated
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue