-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_loop.py
33 lines (31 loc) · 911 Bytes
/
main_loop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# File to store the main program loop
#
import settings
import util
import time
import sys
import traceback
if __name__ == "__main__":
while True:
# scrape time
print "%s: Starting DOG Attack" % time.ctime()
try:
util.dog_attack()
except KeyboardInterrupt:
print "Exiting...."
sys.exit(1)
except Exception as exc:
print "Error with the DOG Attack: %s" % sys.exc_info()[0]
traceback.print_exc()
else:
print "%s: Successfully finished DOG Attack" % time.ctime()
# Sleep time between attacks
try:
time.sleep(settings.SLEEP_INTERVAL)
except KeyboardInterrupt:
print "Exiting...."
sys.exit(1)
except Exception as exc:
print "Error with the sleeping: %s" % sys.exc_info()[0]
traceback.print_exc()