/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/launchpad/cmds.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-15 23:14:11 UTC
  • mfrom: (6852.1.1 lp-logout)
  • Revision ID: jelmer@jelmer.uk-20180215231411-cc1emecmkjuqftrx
Merge lp:~jelmer/brz/lp-logout

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
                                                                        (name,))
144
144
 
145
145
 
 
146
class cmd_launchpad_logout(Command):
 
147
    __doc__ = """Unset the Launchpad user ID.
 
148
 
 
149
    When communicating with Launchpad, some commands need to know your
 
150
    Launchpad user ID.  This command will log you out from Launchpad.
 
151
    This means that communication with Launchpad will happen over
 
152
    HTTPS, and will not require one of your SSH keys to be available.
 
153
    """
 
154
    aliases = ['lp-logout']
 
155
    takes_options = ['verbose']
 
156
 
 
157
    def run(self, verbose=False):
 
158
        from . import account
 
159
        old_username = account.get_lp_login()
 
160
        if old_username is None:
 
161
            self.outf.write(gettext('Not logged into Launchpad.\n'))
 
162
            return 1
 
163
        account.set_lp_login(None)
 
164
        if verbose:
 
165
            self.outf.write(gettext(
 
166
                "Launchpad user ID %s logged out.\n") %
 
167
                old_username)
 
168
 
 
169
 
146
170
# XXX: cmd_launchpad_mirror is untested
147
171
class cmd_launchpad_mirror(Command):
148
172
    __doc__ = """Ask Launchpad to mirror a branch now."""