File tree 3 files changed +6
-5
lines changed
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ def get_index():
17
17
}
18
18
elif functions [i ].__doc__ :
19
19
spl = functions [i ].__doc__ .split ("Example: " )
20
- print (spl )
21
20
route = f"/{ '/' .join (str (j ).split ('/' )[2 :])} "
22
21
dtype = search ("<(.*):" , route )
23
22
default = True if dtype else False
Original file line number Diff line number Diff line change 2
2
3
3
import portolan
4
4
from flask import Blueprint , redirect , request
5
+ from pytz import UTC , timezone
5
6
6
7
from app import app , omw , rounder
7
8
@@ -22,8 +23,10 @@ def current():
22
23
data = omw .get (
23
24
f"/data/2.5/weather?lat=36.99&lon=-122.06&units=imperial&appid={ app .config ['OPENWEATHER_KEY' ]} "
24
25
).json ()
25
- sunrise = datetime .fromtimestamp (int (data ["sys" ]["sunrise" ]))
26
- sunset = datetime .fromtimestamp (int (data ["sys" ]["sunset" ]))
26
+ a = datetime .fromtimestamp (int (data ["sys" ]["sunrise" ]))
27
+ b = datetime .fromtimestamp (int (data ["sys" ]["sunset" ]))
28
+ sunrise = a .astimezone (timezone ("US/Pacific" ))
29
+ sunset = b .astimezone (timezone ("US/Pacific" ))
27
30
28
31
return {
29
32
"name" : data ["name" ],
@@ -34,7 +37,7 @@ def current():
34
37
"wind" : {
35
38
"speed" : f"{ rounder (data ['wind' ]['speed' ])} mph" ,
36
39
"dir" : portolan .abbr (degree = data ["wind" ]["deg" ]),
37
- "gust" : f"{ data ['wind' ]['gust' ]} mph" ,
40
+ "gust" : f"{ rounder ( data ['wind' ]['gust' ]) } mph" ,
38
41
},
39
42
"sunrise" : sunrise .strftime ("%-I:%M %p" ),
40
43
"sunset" : sunset .strftime ("%-I:%M %p" ),
Original file line number Diff line number Diff line change @@ -65,5 +65,4 @@ def readify(text):
65
65
def rounder (num ):
66
66
with localcontext () as ctx :
67
67
ctx .rounding = ROUND_HALF_UP
68
- print (num )
69
68
return Decimal (num ).to_integral_value ()
You can’t perform that action at this time.
0 commit comments