def callback(iq): if iq['type'] == 'result': self.core.information('Password updated', 'Account') if config.get('password'): config.silent_set('password', args[0]) else: self.core.information('Unable to change the password', 'Account')
def callback(iq): if iq['type'] == 'result': self.core.information('Password updated', 'Account') if config.get('password'): config.silent_set('password', args[0]) else: self.core.information('Unable to change the password', 'Account')
def save_to_config_file(self): """ Save various information to the config file e.g. the folded groups """ folded_groups = ':'.join([group.name for group in self.groups.values()\ if group.folded]) log.debug('folded:%s\n', folded_groups) return config.silent_set('folded_roster_groups', folded_groups, 'var')
def save_to_config_file(self): """ Save various information to the config file e.g. the folded groups """ folded_groups = ':'.join([group.name for group in self.groups.values()\ if group.folded]) log.debug('folded:%s\n', folded_groups) return config.silent_set('folded_roster_groups', folded_groups, 'var')
def toggle_offline_show(self): """ Show or hide offline contacts """ option = 'roster_show_offline' value = config.get(option) success = config.silent_set(option, str(not value)) roster.modified() if not success: self.core.information('Unable to write in the config file', 'Error') return True
def toggle_offline_show(self): """ Show or hide offline contacts """ option = 'roster_show_offline' value = config.get(option) success = config.silent_set(option, str(not value)) roster.modified() if not success: self.core.information('Unable to write in the config file', 'Error') return True
def bind(self, args): """ Bind a key. """ if args is None: return self.help('bind') if not config.silent_set(args[0], args[1], section='bindings'): self.core.information('Unable to write in the config file', 'Error') if args[1]: self.core.information('%s is now bound to %s' % (args[0], args[1]), 'Info') else: self.core.information('%s is now reset to the default binding' % args[0], 'Info')
def bind(self, args): """ Bind a key. """ if args is None: return self.help('bind') if not config.silent_set(args[0], args[1], section='bindings'): self.core.information('Unable to write in the config file', 'Error') if args[1]: self.core.information('%s is now bound to %s' % (args[0], args[1]), 'Info') else: self.core.information('%s is now unbound' % args[0], 'Info')
def store_trust(self, jid: JID, state: str, fingerprint: str) -> None: """Store trust for a fingerprint and a jid.""" option_name = '%s:%s' % (self.encryption_short_name, fingerprint) config.silent_set(option=option_name, value=state, section=jid)