Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolocarcagni authored Nov 29, 2022
1 parent 6103e39 commit e89da5e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions duinostats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@

class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'

clear = lambda: os.system('clear') # os.system('cls') for Windows
clear = lambda: os.system('clear') # os.system('cls') on Windows Systems
client = DuinoClient()
username = input('Username: ')
c = 'r'
e = 0
while c != 'q':
clear()
try:
result = client.user(username)
except Exception as error:
print(error)
c = 'q'
e = 100
else:
print(bcolors.OKGREEN + username + "'s balance: " + bcolors.ENDC + str(round(result.balance.balance, 3)) + ' ᕲ')
print(bcolors.OKGREEN + username + "'s miners: " + bcolors.ENDC)
for miner in result.miners:
print('- ' + miner.identifier + ': ' + str(miner.hashrate) + ' H/s')
c = input(bcolors.WARNING + '(r)efresh / (q)uit: ' + bcolors.ENDC)

if e != 0:
if e == 100:
print(bcolors.FAIL + 'Error 100: Check that the entered data is correct' + bcolors.ENDC)
sleep(3)

clear()
print(bcolors.BOLD + 'Developed by iTzNikolovich' + bcolors.ENDC)

0 comments on commit e89da5e

Please sign in to comment.