''' Terminal.py ''' from Pyro.EventService.Clients import Publisher from GeneratedPy.GenTerminal import GenTerminal from sndcs_common.DateTimeMixin import DateTimeMixin from sndcs_common.SndcsExceptions import * from sndcs_common.PyroProxyMixin import PyroProxyMixin from sndcs.Config import config class Terminal(GenTerminal, DateTimeMixin, Publisher, PyroProxyMixin): def __init__(self): GenTerminal.__init__(self) Publisher.__init__(self) self.eventservice._release() # Get the Pyro namespace from the config self.namespace = config.get("pyro", "namespace", "sndcs") def add(self,department): from sndcs.Store import store store.saveChanges() self.publish(self.namespace + "_department_add", {"terminal_name":self.terminalName(), "department": department.code() } ) self.eventservice._release() def delete(self,department): from sndcs.Store import store store.saveChanges() self.publish(self.namespace + "_department_delete", {"terminal_name":self.terminalName(), "department": department.code() } ) self.eventservice._release() def clearSettings(self): from sndcs.Store import store store.saveChanges() self.publish(self.namespace + "_clear_settings", {"terminal_name":self.terminalName() }) self.eventservice._release()