Skip to content

Commit 4661b4a

Browse files
authored
Updated: Linter Errors gone.
1 parent 1b7d7ab commit 4661b4a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Auto Crypto Alert Mail/api_crypto_mail_alert.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ def check_price():
3232
trig_point = float(input("Input the trigger price(dollar) above at which you want to recieve mail alert: "))
3333
else:
3434
trig_point = float(input("Input the trigger price(dollar) below at which you want to recieve mail alert: "))
35-
36-
def send_mail():
35+
36+
def send_mail():
3737
server = smtplib.SMTP(mail_server, mail_port)
3838
server.ehlo()
3939
server.starttls()
4040
server.ehlo()
4141
server.login(from_email, from_email_password)
4242
subject = f"{spot_name.upper()} EXCHANGE RATE"
43-
43+
4444
if cpolarity == 1:
4545
body = f"{spot_name.upper()} Exchange is now above ${trig_point}: Current Exchange Rate: ${lprice}."
4646
else:
4747
body = f"{spot_name.upper()} Exchange is now below ${trig_point}: Current Exchange Rate: ${lprice}."
48-
48+
4949
msg = f'''Subject: {subject}\n
5050
To: {"".join(to_email)}\n
5151
{body}'''
@@ -65,11 +65,11 @@ def send_mail():
6565
if json_list[i]["symbol"] == spot_name.upper():
6666
cryptoname = json_list[i]
6767
try:
68-
lprice = float(cryptoname["lastPrice"])
68+
lprice = float(cryptoname["lastPrice"][4:6])
6969
print(lprice)
7070
except ValueError:
7171
print("This Exchange is not available.")
72-
72+
7373
if lprice >= trig_point and cpolarity == 1:
7474
send_mail()
7575
exit()

0 commit comments

Comments
 (0)