def update_location(self, location): ''' Send browser to a new location. >>> manager = BitcoinManager('blockchain_backup.bitcoin.manager.log') >>> manager.update_location(constants.BACKUP_URL) ''' set_action_update(constants.LOCATION_NAME, location) utils.send_socketio_message(constants.LOCATION_NAME, location)
def update_menu(self, menu_state): ''' Update whether the menu is active or not. >>> manager = BitcoinManager('blockchain_backup.bitcoin.manager.log') >>> manager.update_menu(constants.DISABLE_ITEM) ''' html = f'state={menu_state}' set_action_update('nav-link', html) utils.send_socketio_message('nav-link', html)
def update_alert_color(self, color): ''' Change the color of the alert box. >>> manager = BitcoinManager('blockchain_backup.bitcoin.manager.log') >>> manager.update_alert_color('green') ''' html = f'style=max-width: 40rem; background-color:{color}' set_action_update('alert', html) utils.send_socketio_message('alert', html)
def update_progress(self, text): ''' Send progress update to user. >>> manager = BitcoinManager('blockchain_backup.bitcoin.manager.log') >>> manager.update_progress('Details') ''' if self.last_progress_update != text: self.last_progress_update = text html = text.replace('\n', '<br/>') set_action_update('progress', html) utils.send_socketio_message('progress', html) self.log(f'progress: {text}')
def update_subnotice(self, text): ''' Send a sub-notice to the user. >>> manager = BitcoinManager('blockchain_backup.bitcoin.manager.log') >>> manager.update_subnotice('More info') ''' if self.last_subnotice_update != text: self.last_subnotice_update = text html = text.replace('\n', '<br/>') set_action_update('subnotice', html) utils.send_socketio_message('subnotice', html) self.log(f'subnotice: {text}')
def update_header(self, text): ''' Send an updated header to the user. >>> manager = BitcoinManager('blockchain_backup.bitcoin.manager.log') >>> manager.update_header('Test Header') ''' if self.last_header_update != text: self.last_header_update = text html = text.replace('\n', '<br/>') set_action_update('header', html) utils.send_socketio_message('header', html) self.log(f'header: {text}')