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()
def __init__(self): ProcessEvent(self) self.timer = None