Closed huyphan2612 closed 2 years ago
Hello, may I propose a more generic approach? With this solution the problem will recur whenever the order of the elements within the statusString list is changed, instead turning the list into a dictionary and checking the keys would be more robust.
Something like this:
tmp = statusString.copy()
statusString = {}
for element in tmp:
if element == '':
continue
if element.endswith('slots available now.'):
element = f'{element[-20:-1]}: {element[:-21]}'
splits = element.split(': ')
if len(splits) == 1:
statusString[splits[0]] = ''
else:
statusString[splits[0]] = splits[1]
if ('Rate limit' in statusString.keys()) and (statusString['Rate limit'] == ' 0'):
return True
done in 0.3.5 (see the discussion to issue #55)
Update statusString index to match with status string returned from Overpass API endpoint's status.