just add a sleep function for now
so pi has enough time to access internet upon boot
This commit is contained in:
@@ -20,6 +20,20 @@ import traceback
|
|||||||
from geopy import geocoders
|
from geopy import geocoders
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
|
|
||||||
|
try:
|
||||||
|
time.sleep(80)
|
||||||
|
# f = open('csv/last_updates.json', 'r')
|
||||||
|
# last_updates = json.load(f)
|
||||||
|
# f.close()
|
||||||
|
# last_updates['stocks']['force'] = True
|
||||||
|
#last_updates['weather']['force'] = True
|
||||||
|
# f = open('csv/last_updates.json', 'w')
|
||||||
|
# json.dump(last_updates, f)
|
||||||
|
# f.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def getInput(Block=False):
|
def getInput(Block=False):
|
||||||
if Block or select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []):
|
if Block or select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []):
|
||||||
msg = sys.stdin.read(1)
|
msg = sys.stdin.read(1)
|
||||||
@@ -742,18 +756,18 @@ if __name__ == '__main__':
|
|||||||
t = time.time()
|
t = time.time()
|
||||||
update_processes = []
|
update_processes = []
|
||||||
|
|
||||||
try:
|
# try:
|
||||||
time.sleep(60)
|
# time.sleep(60)
|
||||||
f = open('csv/last_updates.json', 'r')
|
# f = open('csv/last_updates.json', 'r')
|
||||||
last_updates = json.load(f)
|
# last_updates = json.load(f)
|
||||||
f.close()
|
# f.close()
|
||||||
last_updates['stocks']['force'] = True
|
# last_updates['stocks']['force'] = True
|
||||||
#last_updates['weather']['force'] = True
|
# #last_updates['weather']['force'] = True
|
||||||
f = open('csv/last_updates.json', 'w')
|
# f = open('csv/last_updates.json', 'w')
|
||||||
json.dump(last_updates, f)
|
# json.dump(last_updates, f)
|
||||||
f.close()
|
# f.close()
|
||||||
except:
|
# except:
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user