Skip to content

Commit 0c0c096

Browse files
author
Nick Shorter
committed
Cleaned up verbage
1 parent 694f559 commit 0c0c096

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

lib/run.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import requests
66
import logging
77
import aiohttp
8+
from requests.models import Response
89

910
stream_formatter = logging.Formatter(
1011
"%(levelname)s:%(asctime)s:%(module)s:%(message)s"
@@ -61,22 +62,26 @@ def __init__(self, config):
6162
else:
6263
self.logger.setLevel(10)
6364
self.logger.debug(f"Runner logger is set to {self.logger.getEffectiveLevel()}")
64-
def run_non_async_request(self, url):
65+
66+
def run_non_async_request(self, url) -> Response:
6567
response = requests.get(url)
6668
return response
67-
async def get_data(self, url, headers: Dict[str, str]={}):
69+
70+
async def get_data(self, url, headers: Dict[str, str]={}) -> Dict:
6871
self.logger.debug(f'Getting data with URL {url}')
6972
async with aiohttp.ClientSession() as session:
7073
async with session.get(url, headers=headers) as resp:
7174
data = await resp.json()
7275
return data
73-
async def get_non_json_data(self, url, headers: Dict[str, str]={}):
76+
77+
async def get_non_json_data(self, url, headers: Dict[str, str]={}) -> Dict:
7478
self.logger.debug(f'Getting data with URL {url}')
7579
async with aiohttp.ClientSession() as session:
7680
async with session.get(url, headers=headers) as resp:
7781
data = await resp.text()
7882
return data
79-
async def get_img(self, url, headers: Dict[str, str]={}):
83+
84+
async def get_img(self, url, headers: Dict[str, str]={}) -> Dict:
8085
self.logger.debug(f'Getting data with URL {url}')
8186
async with aiohttp.ClientSession() as session:
8287
async with session.get(url, headers=headers) as resp:

lib/stock/stockquote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def run(self) -> Dict:
2626
"""
2727
returns current stock Quotes and Price
2828
"""
29-
self.logger.info("Running Stock Data")
29+
self.logger.info("Running Stock Api")
3030
symbol = self.config.get('symbol')
3131
api_data = await self.get_data(self.url_builder(symbol=symbol))
3232
api_data['symbol'] = symbol

lib/weather/weather.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def get_long_and_lat(self, location: str=None, zipcode: int=None) -> Tuple
8181
self.logger.debug("Getting Lat and Long")
8282
try:
8383
if location:
84-
self.logger.debug("Getting Longitude and Latitude")
84+
self.logger.debug("Computing Longitude and Latitude")
8585
url = f'http://api.openweathermap.org/data/2.5/weather?q={location}&appid={self.token}'
8686
response = await self.get_data(url)
8787
lon = response.get('coord').get('lon')
@@ -117,7 +117,7 @@ async def url_builder(self, location=None, zipcode=None, current_location=False)
117117
return url
118118

119119
async def run(self) -> Dict:
120-
self.logger.info("Using to get Weather")
120+
self.logger.info("Running Api for Weather")
121121
args = await self.parse_args()
122122
api_data = await self.get_data(args)
123123
api_data['name'] = self.get_current_location()['city']

matrix/time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def poll_api(self) -> None:
2424
"""
2525
Function that does not poll since this a time
2626
"""
27-
self.logger.debug("No Api call reqiured for time module")
27+
self.logger.info("No Api call reqiured for time module")
2828
return None
2929

3030
def build_fmt(self) -> str:

0 commit comments

Comments
 (0)