First set of updates from the major "backendification" rewrite #1
| @ -8,8 +8,8 @@ logger = logging.getLogger(__name__) | |||||||
| 
 | 
 | ||||||
| def query_wttr_in(query): | def query_wttr_in(query): | ||||||
|     """Hit the wttr.in JSON API with the provided query.""" |     """Hit the wttr.in JSON API with the provided query.""" | ||||||
|     logger.info(f"about to query wttr.in with '{query}") |     logger.info(f"about to query wttr.in with '{query}'") | ||||||
|     response = requests.get('http://wttr.in/{query}?format=j1') |     response = requests.get(f'http://wttr.in/{query}?format=j1') | ||||||
|     response.raise_for_status() |     response.raise_for_status() | ||||||
| 
 | 
 | ||||||
|     weather_info = response.json() |     weather_info = response.json() | ||||||
| @ -19,7 +19,7 @@ def query_wttr_in(query): | |||||||
| 
 | 
 | ||||||
| def weather_summary(query): | def weather_summary(query): | ||||||
|     """Create a more consumable version of the weather report.""" |     """Create a more consumable version of the weather report.""" | ||||||
|     logger.info(f"assembling weather summary for '{query}") |     logger.info(f"assembling weather summary for '{query}'") | ||||||
|     weather_info = query_wttr_in(query) |     weather_info = query_wttr_in(query) | ||||||
| 
 | 
 | ||||||
|     # get some common/nested stuff once now |     # get some common/nested stuff once now | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user