~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2009-04-04 01:45:09 UTC
  • mfrom: (3873.3.2 trivial)
  • mto: This revision was merged to the branch mainline in revision 4290.
  • Revision ID: jelmer@samba.org-20090404014509-qworcvw6gemoajoo
Merge in Martins' IPv6 literals patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2008 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 (
24
 
    errors,
25
 
    trace,
26
 
    transport,
27
 
    )
 
23
from bzrlib import errors, trace
28
24
from bzrlib.config import AuthenticationConfig, GlobalConfig
 
25
from bzrlib.transport import get_transport
29
26
 
30
27
 
31
28
LAUNCHPAD_BASE = 'https://launchpad.net/'
83
80
def _get_auth_user(auth=None):
84
81
    if auth is None:
85
82
        auth = AuthenticationConfig()
86
 
    username = auth.get_user('ssh', '.launchpad.net')
87
 
    return username
 
83
    return auth.get_user('ssh', '.launchpad.net')
88
84
 
89
85
def _set_auth_user(username, auth=None):
90
86
    if auth is None:
100
96
    uploaded SSH keys.
101
97
    """
102
98
    if _transport is None:
103
 
        _transport = transport.get_transport(LAUNCHPAD_BASE)
 
99
        _transport = get_transport(LAUNCHPAD_BASE)
104
100
 
105
101
    try:
106
102
        data = _transport.get_bytes('~%s/+sshkeys' % username)