~ssweeny/friends/fix-lp1258657

« back to all changes in this revision

Viewing changes to friends/utils/account.py

  • Committer: Robert Bruce Park
  • Date: 2013-03-19 20:12:10 UTC
  • mto: (188.5.10 friends)
  • mto: This revision was merged to the branch mainline in revision 201.
  • Revision ID: robert.park@canonical.com-20130319201210-epsi4ed5sqc59ktp
De-twingle our Account wrapper class from the Authentication class.

This means our Authentication code functions directly on accounts-sso
API calls, with one less layer of glue obfuscating everything.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
from friends.errors import UnsupportedProtocolError
30
30
from friends.utils.manager import protocol_manager
 
31
from friends.utils.authentication import manager
31
32
 
32
33
 
33
34
log = logging.getLogger(__name__)
36
37
def _find_accounts_uoa():
37
38
    """Consult Ubuntu Online Accounts for the accounts we have."""
38
39
    accounts = {}
39
 
    manager = Accounts.Manager.new_for_service_type('microblogging')
40
40
    for service in manager.get_enabled_account_services():
41
41
        try:
42
42
            account = Account(service)
75
75
    id = None
76
76
 
77
77
    def __init__(self, account_service):
78
 
        self.account_service = account_service
79
 
 
80
78
        self.auth = account_service.get_auth_data()
81
79
        if self.auth is not None:
82
80
            auth_params = self.auth.get_parameters()