.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, float|int|Point azimuth) | |
__str__ (self) | |
value (self, Units unit) | |
Point | point (cls, float|int azimuth) |
str | l10n (self, Units unit="Point", babel.Locale|GeoLocation|None locale=None, str template="{value}{unit}", str num_pattern="#,##0") |
Public Attributes | |
float | azimuth = azimuth % self.TURN |
Static Public Attributes | |
Units = typing.Literal["°", "Point"] | |
Point | |
float | TURN = 360.0 |
POINTS = list(typing.get_args(Point)) | |
float | RANGE = TURN / len(POINTS) |
Class for converting compass points and azimuth values (360°)
Definition at line 415 of file weather.py.
searx.weather.Compass.__init__ | ( | self, | |
float | int | Point | azimuth ) |
Definition at line 434 of file weather.py.
searx.weather.Compass.__str__ | ( | self | ) |
Definition at line 441 of file weather.py.
References l10n(), searx.weather.DateTime.l10n(), searx.weather.Pressure.l10n(), searx.weather.RelativeHumidity.l10n(), searx.weather.Temperature.l10n(), and searx.weather.WindSpeed.l10n().
str searx.weather.Compass.l10n | ( | self, | |
Units | unit = "Point", | ||
babel.Locale | GeoLocation | None | locale = None, | ||
str | template = "{value}{unit}", | ||
str | num_pattern = "#,##0" ) |
Definition at line 461 of file weather.py.
References searx.weather._get_sxng_locale_tag(), searx.preferences.BooleanSetting.value, searx.preferences.EnumStringSetting.value, searx.preferences.MapSetting.value, searx.preferences.MultipleChoiceSetting.value, searx.preferences.SearchLanguageSetting.value, searx.preferences.Setting.value, value(), searx.weather.Pressure.value(), searx.weather.RelativeHumidity.value(), searx.weather.Temperature.value(), and searx.weather.WindSpeed.value().
Referenced by __str__().
Point searx.weather.Compass.point | ( | cls, | |
float | int | azimuth ) |
Returns the compass point to an azimuth value.
Definition at line 452 of file weather.py.
References POINTS, RANGE, and TURN.
Referenced by value().
searx.weather.Compass.value | ( | self, | |
Units | unit ) |
Definition at line 444 of file weather.py.
References azimuth, and point().
Referenced by l10n().
searx.weather.Compass.azimuth = azimuth % self.TURN |
Definition at line 439 of file weather.py.
Referenced by value().
|
static |
Definition at line 420 of file weather.py.
|
static |
Definition at line 428 of file weather.py.
Referenced by __init__(), and point().
Definition at line 431 of file weather.py.
Referenced by __init__(), and point().
|
static |
Definition at line 425 of file weather.py.
Referenced by point().
|
static |
Definition at line 418 of file weather.py.