~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/account.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2007-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
than once for each place that needs to take it into account.
21
21
"""
22
22
 
23
 
from bzrlib import errors, trace
 
23
from bzrlib import (
 
24
    errors,
 
25
    trace,
 
26
    transport,
 
27
    )
24
28
from bzrlib.config import AuthenticationConfig, GlobalConfig
25
 
from bzrlib.transport import get_transport
26
29
 
27
30
 
28
31
LAUNCHPAD_BASE = 'https://launchpad.net/'
80
83
def _get_auth_user(auth=None):
81
84
    if auth is None:
82
85
        auth = AuthenticationConfig()
83
 
    return auth.get_user('ssh', '.launchpad.net')
 
86
    username = auth.get_user('ssh', '.launchpad.net')
 
87
    return username
84
88
 
85
89
def _set_auth_user(username, auth=None):
86
90
    if auth is None:
96
100
    uploaded SSH keys.
97
101
    """
98
102
    if _transport is None:
99
 
        _transport = get_transport(LAUNCHPAD_BASE)
 
103
        _transport = transport.get_transport(LAUNCHPAD_BASE)
100
104
 
101
105
    try:
102
106
        data = _transport.get_bytes('~%s/+sshkeys' % username)