2016-12-21 12:44:40 -05:00
|
|
|
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)
|
2016-12-30 20:48:43 -05:00
|
|
|
|
|
|
|
def cleanup():
|
|
|
|
from trespassed.media import MEDIA_CHANNELS
|
|
|
|
MEDIA_CHANNELS.music.stop()
|
|
|
|
|
|
|
|
reactor.addSystemEventTrigger('before', 'shutdown', cleanup)
|