-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
26 lines (22 loc) · 868 Bytes
/
Copy pathutils.py
File metadata and controls
26 lines (22 loc) · 868 Bytes
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
def display_weather(condition):
kwargs = {
'emoji': '\u2600',
'weather': condition['WeatherText'],
}
return '{emoji} {weather}'.format(**kwargs)
def display_temperature(condition):
kwargs = {
'emoji': '\U0001F321',
'value': condition['Temperature']['Metric']['Value'],
'unit': condition['Temperature']['Metric']['Unit'],
}
return '{emoji} {value}°{unit}'.format(**kwargs)
def display_wind(condition):
kwargs = {
'emoji': '\U0001F4A8',
'value': condition['Wind']['Speed']['Metric']['Value'],
'unit': condition['Wind']['Speed']['Metric']['Unit'],
'value_gust': condition['WindGust']['Speed']['Metric']['Value'],
'unit_gust': condition['WindGust']['Speed']['Metric']['Unit'],
}
return '{emoji} {value}{unit} {value_gust}{unit_gust}'.format(**kwargs)