From bcf301ff04bf8fc36d31587fb9701584202fe545 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Sun, 18 Oct 2020 02:19:44 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- nodeconnection.py | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/nodeconnection.py b/nodeconnection.py index 1194afc..319f9e1 100644 --- a/nodeconnection.py +++ b/nodeconnection.py @@ -91,39 +91,24 @@ def remotegetblock(): if os.path.isfile('pyblocksettingsClock.conf') or os.path.isfile('pyblocksettingsClock.conf'): # Check if the file 'bclock.conf' is in the same folder settingsv = pickle.load(open("pyblocksettingsClock.conf", "rb")) # Load the file 'bclock.conf' settingsClock = settingsv # Copy the variable pathv to 'path' - b = rpc('getblockcount') - c = str(b) - if c > a: - output = render(str(c), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') - print("\a" + output) - t.sleep(10) - break - elif c == a: - output = render(str(c), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') - print(output) - t.sleep(10) - clear() - closed() - else: - break else: settingsClock = {"gradient":"", "design":"block", "colorA":"green", "colorB":"yellow"} pickle.dump(settingsClock, open("pyblocksettingsClock.conf", "wb")) - b = rpc('getblockcount') - c = str(b) - if c > a: - output = render(str(c), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') - print("\a" + output) - t.sleep(10) - break - elif c == a: - output = render(str(c), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') - print(output) - t.sleep(10) - clear() - closed() - else: - break + b = rpc('getblockcount') + c = str(b) + if c > a: + output = render(str(c), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') + print("\a" + output) + t.sleep(10) + break + elif c == a: + output = render(str(c), colors=[settingsClock['colorA'], settingsClock['colorB']], align='center') + print(output) + t.sleep(10) + clear() + closed() + else: + break def countdownblockConn(): b = rpc('getblockcount')