def reload(self, account=None, mediatype=None): """Changes the API and/or mediatype and reloads itself.""" if not self.loaded: raise utils.wmalError("Engine is not loaded.") self.unload() if account: self._load(account) if mediatype: self.userconfig['mediatype'] = mediatype self._init_data_handler() self.start()
def reload(self, account=None, mediatype=None): """Changes the API and/or mediatype and reloads itself.""" if not self.loaded: raise utils.wmalError("Engine is not loaded.") self.unload() if account: self.load(account) if mediatype: self.userconfig['mediatype'] = mediatype self._init_data_handler() self.start()
def start(self): """ Starts the engine. This function should be called before doing anything with the engine, as it initializes the data handler. """ if self.loaded: raise utils.wmalError("Already loaded.") # Start the data handler try: (self.api_info, self.mediainfo) = self.data_handler.start() except utils.DataError, e: raise utils.DataFatal(e.message)
def start(self): """ Starts the engine This function should be called before doing anything with the engine, as it initializes the data handler. """ if self.loaded: raise utils.wmalError("Already loaded.") # Start the data handler try: (self.api_info, self.mediainfo) = self.data_handler.start() except utils.DataError, e: raise utils.DataFatal(e.message)