This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
60 lines (43 loc) · 1.83 KB
/
settings.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 2015 Wayne D Grant (www.waynedgrant.com)
# Licensed under the MIT License
from cyclical import Cyclical
from units import PressureUnit
from units import TemperatureUnit
from units import RainfallUnit
from units import WindDirectionUnit
from units import WindSpeedUnit
from weatheritems import WeatherItemType
class Settings:
def __init__(self):
self.__weather_item_types = Cyclical(WeatherItemType().get_all())
self.__pressure_units = Cyclical(PressureUnit().get_all())
self.__rainfall_units = Cyclical(RainfallUnit().get_all())
self.__temperature_units = Cyclical(TemperatureUnit().get_all())
self.__wind_direction_units = Cyclical(WindDirectionUnit().get_all())
self.__wind_speed_units = Cyclical(WindSpeedUnit().get_all())
def next_weather_item_type(self):
self.__weather_item_types.next()
def previous_weather_item_type(self):
self.__weather_item_types.previous()
def get_weather_item_type(self):
return self.__weather_item_types.current()
def change_pressure_unit(self):
self.__pressure_units.next()
def get_pressure_unit(self):
return self.__pressure_units.current()
def change_rainfall_unit(self):
self.__rainfall_units.next()
def get_rainfall_unit(self):
return self.__rainfall_units.current()
def change_temperature_unit(self):
self.__temperature_units.next()
def get_temperature_unit(self):
return self.__temperature_units.current()
def change_wind_direction_unit(self):
self.__wind_direction_units.next()
def get_wind_direction_unit(self):
return self.__wind_direction_units.current()
def change_wind_speed_unit(self):
self.__wind_speed_units.next()
def get_wind_speed_unit(self):
return self.__wind_speed_units.current()