def _on_procman_orders(self, channel, data): if self.sheriff.is_observer(): return msg = orders_t.decode(data) if self.sheriff.name != msg.sheriff_name: # detected the presence of another sheriff that is not this one. # self-demote to prevent command thrashing self.sheriff.set_observer(True)
def on_procman_orders (self, channel, data): msg = orders_t.decode (data) if not self.sheriff.is_observer () and \ self.sheriff.name != msg.sheriff_name: # detected the presence of another sheriff that is not this one. # self-demote to prevent command thrashing self.set_observer (True) self.statusbar.push (self.statusbar.get_context_id ("main"), "WARNING: multiple sheriffs detected! Switching to observer mode"); gobject.timeout_add (6000, lambda *s: self.statusbar.pop (self.statusbar.get_context_id ("main")))
def on_procman_orders (self, channel, data): msg = orders_t.decode (data) if not self.sheriff.is_observer () and \ self.sheriff.get_name() != msg.sheriff_name: # detected the presence of another sheriff that is not this one. # self-demote to prevent command thrashing self.set_observer (True) self.statusbar.push (self.statusbar.get_context_id ("main"), "WARNING: multiple sheriffs detected! Switching to observer mode"); gobject.timeout_add (6000, lambda *s: self.statusbar.pop (self.statusbar.get_context_id ("main")))