Skip to content

Commit 8958bde

Browse files
author
xinshen
committed
Remove unnecessary comparaison ('== True' or '!= None')
1 parent f357f54 commit 8958bde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/notification.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def notify_all(self, new_analysis):
138138

139139
messages = self.get_indicator_messages(new_analysis)
140140

141-
if self.enable_charts == True:
141+
if self.enable_charts:
142142
if not os.path.exists(charts_dir):
143143
os.mkdir(charts_dir)
144144

@@ -158,7 +158,7 @@ def notify_all(self, new_analysis):
158158
def notify_all_messages(self, exchange, market_pair, candle_period, messages):
159159
chart_file = None
160160

161-
if self.enable_charts == True:
161+
if self.enable_charts:
162162
try:
163163
candles_data = self.all_historical_data[exchange][market_pair][candle_period]
164164
chart_file = self.create_chart(
@@ -258,8 +258,8 @@ def notify_telegram(self, messages, chart_file):
258258
for message in messages:
259259
formatted_messages.append(message_template.render(message))
260260

261-
if self.enable_charts == True:
262-
if chart_file != None and os.path.exists(chart_file):
261+
if self.enable_charts:
262+
if chart_file and os.path.exists(chart_file):
263263
try:
264264
self.telegram_client.send_chart_messages(
265265
open(chart_file, 'rb'), formatted_messages)
@@ -644,7 +644,7 @@ def get_indicator_messages(self, new_analysis):
644644
# Merge changes from new analysis into last analysis
645645
self.last_analysis = {**self.last_analysis, **new_analysis}
646646

647-
if self.first_run == True:
647+
if self.first_run:
648648
self.first_run = False
649649

650650
return new_messages

0 commit comments

Comments
 (0)