Skip to content

Commit

Permalink
Merge pull request #13 from gileadmcgee/master
Browse files Browse the repository at this point in the history
enabled turning off feed scripts
  • Loading branch information
xeroc committed Oct 23, 2015
2 parents f8ceab1 + 0627c20 commit 5e33608
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
2 changes: 2 additions & 0 deletions scripts/watcher/config-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@

# the minute of each hour that you would like the feed script triggered.
feed_script_time = 42

feed_script_active = False
42 changes: 15 additions & 27 deletions scripts/watcher/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

rpc = GrapheneWebsocket("localhost", 8092, "", "")


def unlockWallet():
if config.feed_script_active = True:
print("unlocking wallet")
rpc.unlock(config.wallet_password)
time.sleep(10)

def closeScreens():
print("closing wallet")
Expand Down Expand Up @@ -54,19 +58,13 @@ def watch(tries):
if tries > 2:
closeScreens()
resync()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
print("wallet unlocked")
time.sleep(30)
unlockWallet()
tries = 0
return tries
else:
closeScreens()
openScreens()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
print("wallet unlocked")
time.sleep(30)
unlockWallet()
tries += 1
return tries
else:
Expand Down Expand Up @@ -99,8 +97,7 @@ def checkTime():
crash = 0
closeScreens()
openScreens()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
unlockWallet()



Expand All @@ -117,53 +114,44 @@ def checkTime():
crash = 0
closeScreens()
resync()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
print("wallet unlocked")
unlockWallet()
else:
crash += 1
print("error. restarting.")
closeScreens()
openScreens()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
print("wallet unlocked")
unlockWallet()
except:
try:
if crash > 2:
crash = 0
closeScreen()
resync()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
unlockWallet()
else:
crash += 1
print("error... restarting")
closeScreens()
openScreens()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
unlockWallet()
except:
try:
if crash > 2:
crash = 0
closeScreens()
resync()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
unlockWallet()
else:
crash += 1
print("error. restarting.")
closeScreens()
openScreens()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
unlockWallet()
except:
crash = 0
closeScreens()
resync()
print("unlocking wallet")
rpc.unlock(config.wallet_password)
unlockWallet()



Expand Down

0 comments on commit 5e33608

Please sign in to comment.