#!/usr/local/bin/python


import redis
import time
# Start connection to localhost redis server
r = redis.StrictRedis(host='localhost', port=6379, db=0)
print 'Resetting leibniz...'
# Allow for exiting beforing resetting
print 'Press Ctrl+C in 5 seconds to stop this.'
time.sleep(5)
# Set the defaults
r.set('iterations', '16')
r.set('scale', '64')
# Only change these if you know what you are doing
r.set('seed', '1')
r.set('pi', '0')
print 'Printing new values...'
# Get the latest values we set from redis
riterations = r.get('iterations')
rscale = r.get('scale')
rseed = r.get('seed')
rpi = r.get('pi')
# Print them out
print 'Iterations: ', riterations
print 'Scale: ', rscale
print 'Seed: ', rseed
print 'Pi: ', rpi
print 'You can change these values by editing the leibniz-reset file.'
