-
Notifications
You must be signed in to change notification settings - Fork 0
/
timer.py
37 lines (27 loc) · 800 Bytes
/
timer.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
34
35
36
import time
from Wunderground_pull import Wunderground_pull
from Analyze_Data import Analyze_Data
class timer:
listofCities = [("New_York",'NY'),("Los_Angeles","CA"),("Ardmore","PA"),("Honolulu","HI"),("Boulder","CO"),("Aurora","CO")]
listofobservers = []
def _init_(self):
pass
def attach(self, observer):
self.listofobservers.append(observer)
def Notify(self):
for o in self.listofobservers:
o.update(self.listofCities)
def monitorDate(self):
#currentDate = (time.strftime("%d/%m/%Y"))
#print 'going to sleep soon test'
while(1):
#self.__update()
#time.sleep(86400)
self.Notify()
time.sleep(86400/2)
t = timer()
observer1 = Wunderground_pull("Wunderground")
observer2 = Analyze_Data()
t.attach(observer1)
t.attach(observer2)
t.monitorDate()