1
0
Fork 0
trespassed/software/main.py

20 lines
619 B
Python

from twisted.application.service import Service, Application
from twisted.internet import reactor
from trespassed.serial import SerialService, watchdog_service
from trespassed.email import email_routine
reactor.callLater(5, email_routine, "Trespassed Service Restarted",
"")
application = Application("Trespassed")
serial_service = SerialService()
watchdog_service.setServiceParent(application)
serial_service.setServiceParent(application)
def cleanup():
from trespassed.media import MEDIA_CHANNELS
MEDIA_CHANNELS.music.stop()
reactor.addSystemEventTrigger('before', 'shutdown', cleanup)