Fix crypto script

This commit is contained in:
samedamci 2020-07-28 21:52:18 +02:00
parent e0fe892c47
commit 3f68cbc529
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894

View File

@ -5,10 +5,13 @@ import json
def __LBC():
try:
data = subprocess.run(
["lbrynet", "account", "list"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
["lbrynet", "account", "list"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if data.stderr != b'':
if data.stderr != b"":
return None
data = json.loads(data.stdout)
balance: float = 0
@ -16,6 +19,8 @@ def __LBC():
d = data["items"][i]["coins"]
balance += float(d)
return round(balance, 1)
except json.decoder.JSONDecodeError:
return None
def __DOGE():
@ -25,7 +30,7 @@ def __DOGE():
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if data.stderr != b'':
if data.stderr != b"":
return None
balance = json.loads(data.stdout)
return round(balance, 1)
@ -40,7 +45,7 @@ def __BTC():
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if data.stderr != b'':
if data.stderr != b"":
return None
balance = json.loads(data.stdout)
return round(balance, 1)