All pastes #969013 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-03 13:08 UTC
rendered paste body
"""
    Demo Service
"""

class LifeBeat(Service):
    _svc_name_ = "LifeBeat"
    _svc_display_name_ = "LifeBeat"
    _svc_description_ = "Sends an event to the log every 10 seconds"
    
    def service(self):
        while self.isAlive:
            self.log("LifeBeat - ticking")
            time.sleep(10)
        self.log("LifeBeat - Stopped")
[15:07:04] … def SvcDoRun(self):
        self.service()
[15:07:19] …   def log(self, msg):
        import servicemanager
        servicemanager.LogInfoMsg(msg)