v.0.10.0 redesign prj structure, multi dev containers

This commit is contained in:
tiijay
2025-11-20 11:50:19 +00:00
parent 53b1b96fb3
commit 76a8203458
52 changed files with 63 additions and 83 deletions

View File

@@ -0,0 +1,48 @@
from .weather import Weather
from .response_status import ResponseStatus
class WeatherResponse:
_response_status: ResponseStatus
_weather: Weather
def __init__(self):
self._weather = None
self._response_status = None
# Weather property with getter and setter
@property
def weather(self)->Weather:
"""Get the weather data"""
return self._weather
@weather.setter
def weather(self, value:Weather)->None:
"""Set the weather data with validation"""
if value is not None and not isinstance(value, Weather):
raise TypeError("weather must be an instance of Weather class")
self._weather = value
# ResponseStatus property with getter and setter
@property
def response_status(self)->ResponseStatus:
"""Get the response status"""
return self._response_status
@response_status.setter
def response_status(self, value:ResponseStatus)->None:
"""Set the response status with validation"""
if value is not None and not isinstance(value, ResponseStatus):
raise TypeError("response_status must be an instance of ResponseStatus class")
self._response_status = value
# Additional utility methods
def is_successful(self)->bool:
"""Check if the response was successful"""
return self._response_status is not None
def has_weather_data(self)->bool:
"""Check if weather data is available"""
return self._weather is not None
def __str__(self)->str:
return f"WeatherResponse(weather={self._weather}, status={self._response_status})"