/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 bzrlib/plugins/launchpad/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2009-07-15 07:32:26 UTC
  • mfrom: (4536 +trunk)
  • mto: (4536.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4537.
  • Revision ID: v.ladeuil+lp@free.fr-20090715073226-a7ylxd6ctbzeu0o6
Merge trunk resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from bzrlib.lazy_import import lazy_import
28
28
lazy_import(globals(), """
29
 
import webbrowser
30
 
 
31
29
from bzrlib import (
32
30
    branch as _mod_branch,
33
31
    trace,
196
194
        web_url = self._get_web_url(LaunchpadService(), location)
197
195
        trace.note('Opening %s in web browser' % web_url)
198
196
        if not dry_run:
 
197
            import webbrowser   # this import should not be lazy
 
198
                                # otherwise bzr.exe lacks this module
199
199
            webbrowser.open(web_url)
200
200
 
201
201
register_command(cmd_launchpad_open)
220
220
    aliases = ['lp-login']
221
221
    takes_args = ['name?']
222
222
    takes_options = [
 
223
        'verbose',
223
224
        Option('no-check',
224
225
               "Don't check that the user name is valid."),
225
226
        ]
226
227
 
227
 
    def run(self, name=None, no_check=False):
 
228
    def run(self, name=None, no_check=False, verbose=False):
228
229
        from bzrlib.plugins.launchpad import account
229
230
        check_account = not no_check
230
231
 
233
234
            if username:
234
235
                if check_account:
235
236
                    account.check_lp_login(username)
 
237
                    if verbose:
 
238
                        self.outf.write(
 
239
                            "Launchpad user ID exists and has SSH keys.\n")
236
240
                self.outf.write(username + '\n')
237
241
            else:
238
242
                self.outf.write('No Launchpad user ID configured.\n')
241
245
            name = name.lower()
242
246
            if check_account:
243
247
                account.check_lp_login(name)
 
248
                if verbose:
 
249
                    self.outf.write(
 
250
                        "Launchpad user ID exists and has SSH keys.\n")
244
251
            account.set_lp_login(name)
 
252
            if verbose:
 
253
                self.outf.write("Launchpad user ID set to '%s'.\n" % (name,))
245
254
 
246
255
register_command(cmd_launchpad_login)
247
256
 
259
268
    from bzrlib.plugins.launchpad import (
260
269
        test_account,
261
270
        test_lp_directory,
 
271
        test_lp_login,
262
272
        test_lp_open,
263
273
        test_lp_service,
264
274
        test_register,
270
280
        test_account,
271
281
        test_register,
272
282
        test_lp_directory,
 
283
        test_lp_login,
273
284
        test_lp_open,
274
285
        test_lp_service,
275
286
        ]: