mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-17 13:07:17 +02:00
Merge pull request #159 from curly60e/curly60e-patch-106
Sounds per block
This commit is contained in:
commit
cf1b2567f5
3 changed files with 53 additions and 32 deletions
56
PyBlock.py
56
PyBlock.py
|
|
@ -29,13 +29,14 @@ from nodeconnection import *
|
|||
from terminal_matrix.matrix import *
|
||||
|
||||
|
||||
version = "0.7.3"
|
||||
version = "0.7.4"
|
||||
|
||||
def sysinfo(): #Cpu and memory usage
|
||||
print(" \033[0;37;40m----------------------")
|
||||
print(" \033[3;33;40mCPU Usage: \033[1;32;40m" + str(psutil.cpu_percent()) + "%\033[0;37;40m")
|
||||
print(" \033[3;33;40mMemory Usage: \033[1;32;40m" "{}% \033[0;37;40m".format(int(psutil.virtual_memory().percent)))
|
||||
print(" \033[0;37;40m----------------------")
|
||||
print("\a")
|
||||
|
||||
def getblock(): # get access to bitcoin-cli with the command getblockchaininfo
|
||||
bitcoincli = " getblockchaininfo"
|
||||
|
|
@ -124,35 +125,40 @@ def connected(info): # here we complete the connection to the external node
|
|||
menu()
|
||||
|
||||
def artist(): # here we convert the result of the command 'getblockcount' on a random art design
|
||||
custom = input("Do you want random designs? Y/n: ")
|
||||
if custom in ["Y", "y"]:
|
||||
while True:
|
||||
try:
|
||||
clear()
|
||||
close()
|
||||
design()
|
||||
tmp()
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
menu()
|
||||
raise
|
||||
else:
|
||||
while True:
|
||||
try:
|
||||
clear()
|
||||
close()
|
||||
getblockcount()
|
||||
tmp()
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
menu()
|
||||
raise
|
||||
while True:
|
||||
try:
|
||||
clear()
|
||||
close()
|
||||
design()
|
||||
tmp()
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
menu()
|
||||
raise
|
||||
|
||||
def design():
|
||||
bitcoinclient = path['bitcoincli'] + " getblockcount"
|
||||
block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string
|
||||
b = block
|
||||
print("\033[1;32;40m")
|
||||
tprint(b, font="rnd-large")
|
||||
print("\033[0;37;40m")
|
||||
a = b
|
||||
while True:
|
||||
bitcoinclient = path['bitcoincli'] + " getblockcount"
|
||||
block = os.popen(str(bitcoinclient)).read() # 'getblockcount' convert to string
|
||||
b = block
|
||||
if b > a:
|
||||
print("\033[1;32;40m")
|
||||
tprint(b, font="rnd-large")
|
||||
print("\a\033[0;37;40m")
|
||||
t.sleep(10)
|
||||
break
|
||||
elif b == a:
|
||||
print("\033[1;32;40m")
|
||||
tprint(b, font="rnd-large")
|
||||
print("\033[0;37;40m")
|
||||
t.sleep(10)
|
||||
clear()
|
||||
closed()
|
||||
else:
|
||||
break
|
||||
|
||||
|
||||
#--------------------------------- Hex Block Decoder Functions -------------------------------------
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ lndconnectload = {"ip_port":"", "tls":"", "macaroon":"", "ln":""}
|
|||
|
||||
def clear(): # clear the screen
|
||||
os.system('cls' if os.name=='nt' else 'clear')
|
||||
def closed():
|
||||
print("<<< Back Control + C.\n\n")
|
||||
|
||||
if os.path.isfile('blndconnect.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||||
lndconnectData= pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf'
|
||||
|
|
@ -48,14 +50,27 @@ def rpc(method, params=[]):
|
|||
return requests.post(path['ip_port'], auth=(path['rpcuser'], path['rpcpass']), data=payload).json()['result']
|
||||
|
||||
def remotegetblock():
|
||||
try:
|
||||
b = rpc('getblockcount')
|
||||
c = str(b)
|
||||
a = c
|
||||
while True:
|
||||
b = rpc('getblockcount')
|
||||
c = str(b)
|
||||
print("\033[1;32;40m")
|
||||
tprint(c, font="rnd-large")
|
||||
print("\033[0;37;40m")
|
||||
except:
|
||||
pass
|
||||
if c > a:
|
||||
print("\033[1;32;40m")
|
||||
tprint(c, font="rnd-large")
|
||||
print("\a\033[0;37;40m")
|
||||
t.sleep(10)
|
||||
break
|
||||
elif c == a:
|
||||
print("\033[1;32;40m")
|
||||
tprint(c, font="rnd-large")
|
||||
print("\033[0;37;40m")
|
||||
t.sleep(10)
|
||||
clear()
|
||||
closed()
|
||||
else:
|
||||
break
|
||||
|
||||
def remotegetblockcount(): # get access to bitcoin-cli with the command getblockcount
|
||||
try:
|
||||
|
|
|
|||
2
ver.txt
2
ver.txt
|
|
@ -1 +1 @@
|
|||
{"version":"0.7.3"}
|
||||
{"version":"0.7.4"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue