-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_system.py
54 lines (40 loc) · 1.07 KB
/
run_system.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from fbchat import log, Client
from fbchat.models import *
from geeteventbus.subscriber import subscriber
from geeteventbus.eventbus import eventbus
from geeteventbus.event import event
from time_event_queuer import *
from message_parser import *
from fb_client import *
from event_constants import *
from internet_status import InternetStatus
from weather_forcast import WeatherForcast
import time
import requests
import threading
import random
import datetime
def main():
eb = eventbus()
parser = MessageParser(eb)
cv = threading.Condition() #conditional Variable
teq = TimeEventQueuer(eb,cv)
teq.start()
internet_check = InternetStatus(eb)
weather_forcast = WeatherForcast(eb)
client = FbClient(eb,parser)
client.start()
#eb.post(event(EVENTID_CLIENT_START,""))
"""
print("Joining")
while(client.isAlive()):
time.sleep(1)
client.join()
"""
client.join()
print ("Exiting Main Thread")
eb.post(event(EVENTID_QUEUE_STOP,""))
teq.join()
eb.shutdown()
if __name__ == "__main__":
main()