Skip to content

Commit 051710a

Browse files
committed
style: fix PEP8 violations in code formatting
1 parent f5bcf7e commit 051710a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tfinance/database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def select_stock(self, user: User, stock_name: str):
168168
)
169169
self.con.commit()
170170

171-
def get_selected_stock_byid(self, user: User, message_id) -> str:
171+
def get_selected_stock_byid(self, user: User, message_id) -> str | None:
172172
"""
173173
Получить название акции по id сообщения с игрой.
174174
:param user: Экземпляр класса User с данными об этом пользователе.
@@ -182,6 +182,7 @@ def get_selected_stock_byid(self, user: User, message_id) -> str:
182182
for i in data.split():
183183
if str(message_id) == i.split(":")[-1]:
184184
return i.split(":")[0]
185+
return None
185186

186187
def get_selected_stocks(self, user: User) -> list:
187188
"""

tfinance/stock.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ def load_stocks(file_name: str) -> list[dict[str, str]]:
2525
def check_stock(stock_name: str) -> bool:
2626
try:
2727
stock = yf.download(stock_name, period="1mo")
28-
if stock["Close"][-2]:
29-
return True
28+
return bool(stock["Close"][-2])
3029
except Exception as e:
3130
logging.exception(e)
3231
return False

0 commit comments

Comments
 (0)