Ejemplo n.º 1
0
    def _monitor_lockfile(self):
        eh = ProcessEvent()
        events_to_watch = 0
        if self.when_user_stops_using_oled:
            eh.process_IN_CLOSE_WRITE = lambda event: self.when_user_stops_using_oled(
            )
            events_to_watch = events_to_watch | IN_CLOSE_WRITE
        if self.when_user_starts_using_oled:
            eh.process_IN_OPEN = lambda event: self.when_user_starts_using_oled(
            )
            events_to_watch = events_to_watch | IN_OPEN

        wm = WatchManager()
        wm.add_watch(self.lock_path, events_to_watch)
        notifier = Notifier(wm, eh)
        notifier.loop()
Ejemplo n.º 2
0
 def __init__(self):
     ProcessEvent(self)
     self.timer = None