Esempio n. 1
0
 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')
Esempio n. 2
0
 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')
Esempio n. 3
0
 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')
Esempio n. 4
0
 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')
Esempio n. 5
0
 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
Esempio n. 6
0
 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
Esempio n. 7
0
    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')
Esempio n. 8
0
    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')
Esempio n. 9
0
 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)