summaryrefslogtreecommitdiff
path: root/offline_reconnect.py
blob: d36b46a7bb11f8d44f9e4b325d2a7cfad4a71c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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"