diff options
author | ttt | 2017-05-13 00:29:47 +0530 |
---|---|---|
committer | ttt | 2017-05-13 00:29:47 +0530 |
commit | abf599be33b383a6a5baf9493093b2126a622ac8 (patch) | |
tree | 4c5ab6e0d935d5e65fabcf0258e4a00dd20a5afa /offline_reconnect.py | |
download | SBHS-2018-Rpi-abf599be33b383a6a5baf9493093b2126a622ac8.tar.gz SBHS-2018-Rpi-abf599be33b383a6a5baf9493093b2126a622ac8.tar.bz2 SBHS-2018-Rpi-abf599be33b383a6a5baf9493093b2126a622ac8.zip |
added all server files
Diffstat (limited to 'offline_reconnect.py')
-rw-r--r-- | offline_reconnect.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/offline_reconnect.py b/offline_reconnect.py new file mode 100644 index 0000000..d36b46a --- /dev/null +++ b/offline_reconnect.py @@ -0,0 +1,18 @@ +#Dev /KoDe + +import datetime +import os +import sys + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sbhs_server.settings") # To make a Django Environment. +from sbhs_server.tables.models import Board +from sbhs_server.sbhs import Sbhs +offline_mid = Board.objects.filter(online=False).values_list("mid", flat = True) +s = Sbhs() +for mid in offline_mid: + i = 1 + while i<5: + print "{0} trying mid {1} to reconnect".format(i,mid) + s.connect(mid) + i+=1 + print "could not connect" |