-
Notifications
You must be signed in to change notification settings - Fork 1
/
ravioli.py
executable file
·51 lines (37 loc) · 1.34 KB
/
ravioli.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
#! /usr/bin/env python
from threading import Thread
from art import tprint
from flour import log_neko
from pasta.siakad_auto_attendance.main import start as saa_start
from pasta.task_scheduler.main import start as ts_start
from pasta.siakad_auto_attendance.utils import connectionCheck as connection_check
from flour.event_scheduler.scheduler import Scheduler as EventScheduler
from flour.event_scheduler.scheduler_task import scheduler_task
import ravioli_systray
if __name__ == '__main__':
tprint("{*} RAVIOLI")
log_neko.compose_info("Starting event scheduler");
event_scheduler = EventScheduler()
event_scheduler_thread = Thread(
name="SchedulerThread",
target=scheduler_task,
args=[event_scheduler]
)
attendance_form_filler_thread = Thread(
name="SiakadAutoAttendanceThread",
target=saa_start,
args=[event_scheduler]
)
task_scheduler_thread = Thread(
name="TaskSchedulerThread",
target=ts_start,
args=[event_scheduler]
)
event_scheduler_thread.start()
task_scheduler_thread.start()
attendance_form_filler_thread.start()
ravioli_systray.start(event_scheduler)
attendance_form_filler_thread.join()
task_scheduler_thread.join()
event_scheduler.publish("flow_control", "terminate_scheduler")
event_scheduler_thread.join()