/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/lp_api.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-02-15 00:19:02 UTC
  • mfrom: (7282.1.1 launchpadlib-error)
  • Revision ID: breezy.the.bot@gmail.com-20190215001902-0597myoieiu0mjsh
Add clearer error when launchpadlib is missing.

Merged from https://code.launchpad.net/~jelmer/brz/launchpadlib-error/+merge/363218

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    )
46
46
from ...i18n import gettext
47
47
 
 
48
 
 
49
class LaunchpadlibMissing(errors.DependencyNotPresent):
 
50
 
 
51
    _fmt = ("launchpadlib is required for Launchpad API access. "
 
52
            "Please install the launchpadlib package.")
 
53
 
 
54
    def __init__(self, e):
 
55
        super(LaunchpadlibMissing, self).__init__(
 
56
            'launchpadlib', e)
 
57
 
48
58
try:
49
59
    import launchpadlib
50
60
except ImportError as e:
51
 
    raise errors.DependencyNotPresent('launchpadlib', e)
 
61
    raise LaunchpadlibMissing(e)
52
62
 
53
63
from launchpadlib.launchpad import (
54
64
    Launchpad,