Exemplo n.º 1
0
 def _init_account_from_gconf(self, path):
     """Setup an Account class with values from GConf."""
     email = self.gconf.get_value("{0}/email".format(path))
     account = Account(email)
     for pspec in account.props:
         if pspec.name == "password":
             auth_token = self.gconf.get_value("{0}/auth_token".format(path))
             account.props.password = self.keyring.get_password(auth_token)
         elif pspec.name != "email":
             setattr(account.props, pspec.name, self.gconf.get_value("{0}/{1}".format(path, pspec.name)))
     self._account_hid[account.props.email] = account.connect("notify", self._account_prop_changed)
     self._accounts.append(account)
     return account