def update(self):
     if self.update_flag:
         self.logger.info('Updating client...')
         update_file_name = config.get_settings()['update']['update_file_name']
         try:
             urllib.urlretrieve(config.get_settings()['update']['update_file_url'] + update_file_name, update_file_name)
         except Exception as e:
             error_message = 'Update failed!\nReason: error while downloading.\nDetails: ' + str(e)
             config.create_error_report(0, error_message, None, self.logger, is_blocking=True)
             return error_message
         else:
             error = self.extract_update(update_file_name)
             if error:
                 return error
             self.logger.info('...client successfully updated!')
             self.update_flag = False
             log.send_logs()
             log.clear_logs()
 def clear_logs(self):
     log.clear_logs()
     self.write_message('Logs successfully cleared. Writing logs stopped. \
                        <br><br>Please restart 3DPrinterOS Client to start writing new logs!'
                        + self.page_former.form_back_button('/'), show_time=0)