def __init__(self, swap_settings=None): """ Class constructor @param swap_settings: path to the main SWAP configuration file @param verbose: Print out SWAP frames or not @param monitor: Print out network events or not """ # Main configuration file self.swap_settings = swap_settings # Print SWAP activity self._print_swap = False try: self.main_settings = XmlSettings(self.swap_settings) # Set log file to trace lagarto exceptions LagartoException.error_file = XmlSettings.error_file # Superclass call SwapInterface.__init__(self, swap_settings) except: raise # Lagarto server constructor LagartoServer.__init__(self, working_dir) if XmlSettings.debug == 2: self._print_swap = True self.lagarto_config = XmlLagarto(os.path.join(config_dir, "lagarto.xml"))
def __init__(self, swap_settings=None): """ Class constructor @param swap_settings: path to the main SWAP configuration file @param verbose: Print out SWAP frames or not @param monitor: Print out network events or not """ # MAin configuration file self.swap_settings = swap_settings # Print SWAP activity self._print_swap = False try: # Superclass call SwapInterface.__init__(self, swap_settings) except: raise # Lagarto server constructor LagartoServer.__init__(self, working_dir) if XmlSettings.debug == 2: self._print_swap = True self.log("Logging enabled")
def __init__(self, swap_settings=None, abort_call=None): """ Class constructor @param swap_settings: path to the main SWAP configuration file @param verbose: Print out SWAP frames or not @param monitor: Print out network events or not @param abort_call: Call in case of abrupt hang mode """ self.parent_abort_call = abort_call # MAin configuration file self.swap_settings = swap_settings # Print SWAP activity self._print_swap = False try: # Superclass call SwapInterface.__init__(self, swap_settings, abort_call=self.abort_call) except: raise # Lagarto server constructor LagartoServer.__init__(self, working_dir) if XmlSettings.debug == 2: self._print_swap = True
def stop(self): """ Stop SWAP manager """ # Stop SWAP server self.server.stop() # Stop Lagarto server LagartoServer.stop(self)
def stop(self, internal=False): """ Stop SWAP manager """ # Stop SWAP server self.server.stop() # Stop Lagarto server LagartoServer.stop(self) if internal and self.abort_call: self.abort_call()
def __init__(self): """ Constructor """ # Read config config_file = os.path.join(working_dir, "config", "settings.xml") self.general_settings = XmlSettings(config_file) # Lagarto server constructor LagartoServer.__init__(self, working_dir) # Network object containing speech-related endpoints self.network = SpeechNetwork(self) # Text to speech engine self.speech_producer = SpeachProducer(self, self.general_settings.language) self.speech_producer.speak(self.general_settings.welcomemsg) # Speech Listener SpeechListener(self, self.general_settings.language, self.general_settings.keyword)
def __init__(self, swap_settings=None): """ Class constructor @param swap_settings: path to the main SWAP configuration file @param verbose: Print out SWAP frames or not @param monitor: Print out network events or not """ # MAin configuration file self.swap_settings = swap_settings # Print SWAP activity self._print_swap = False try: # Superclass call SwapInterface.__init__(self, swap_settings) except: raise # Lagarto server constructor LagartoServer.__init__(self, working_dir) if XmlSettings.debug == 2: self._print_swap = True
def abort_call(self): LagartoServer.stop(self) if self.parent_abort_call: self.parent_abort_call()