File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 19
19
20
20
import requests
21
21
import grequests
22
+ from typing import Dict
22
23
23
24
sess = requests .session ()
24
25
@@ -41,7 +42,7 @@ def get_locations():
41
42
return get_locations_by_status ()
42
43
43
44
44
- def get_locations_by_status (status = None ):
45
+ def get_locations_by_status (status : str = None ) -> List [ Dict [ str , str ]] :
45
46
# status can be nil, open, or closed
46
47
# None - returns all dining locations
47
48
# 'all' - same as None (or anything else)
@@ -96,7 +97,7 @@ def get_locations_by_status(status=None):
96
97
# return []
97
98
98
99
99
- def _encode_dining_location (string ) :
100
+ def _encode_dining_location (string : str ) -> str :
100
101
# changes full name into dict key name
101
102
string = string .lower ()
102
103
string = string .replace (' ' , '_' )
Original file line number Diff line number Diff line change 22
22
import requests
23
23
from bs4 import BeautifulSoup
24
24
25
+ from typing import Dict , List
26
+
25
27
session = requests .session ()
26
28
27
29
location_dict = {
36
38
}
37
39
38
40
39
- def get_status_simple (building_name ) :
41
+ def get_status_simple (building_name : str ) -> Dict [ str , str ] :
40
42
"""
41
43
:returns: a dictionary with free washers and dryers as well as total washers
42
44
and dryers for given building
@@ -75,7 +77,7 @@ def get_status_simple(building_name):
75
77
return di
76
78
77
79
78
- def get_status_detailed (building_name ) :
80
+ def get_status_detailed (building_name : str ) -> List [ Dict [ str , str ]] :
79
81
building_name = building_name .upper ()
80
82
81
83
# Get a cookie
@@ -113,7 +115,7 @@ def get_status_detailed(building_name):
113
115
114
116
cleaned_resp = [x for x in cleaned_resp if len (x ) == 10 ]
115
117
116
- di = []
118
+ di = [] # type: List[Dict[str,str]]
117
119
for machine in cleaned_resp :
118
120
time_left = - 1
119
121
machine_name = "{}_{}" .format (machine [9 ], machine [3 ])
You can’t perform that action at this time.
0 commit comments