/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/help.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    )
37
37
 
38
38
 
 
39
class NoHelpTopic(errors.BzrError):
 
40
 
 
41
    _fmt = ("No help could be found for '%(topic)s'. "
 
42
        "Please use 'brz help topics' to obtain a list of topics.")
 
43
 
 
44
    def __init__(self, topic):
 
45
        self.topic = topic
 
46
 
 
47
 
39
48
def help(topic=None, outfile=None):
40
49
    """Write the help for the specific topic to outfile"""
41
50
    if outfile is None:
52
61
                topic_obj.get_help_topic()))
53
62
        source = topics[0][1]
54
63
        outfile.write(source.get_help_text(shadowed_terms))
55
 
    except errors.NoHelpTopic:
 
64
    except NoHelpTopic:
56
65
        if alias is None:
57
66
            raise
58
67
 
162
171
        for index in self.search_path:
163
172
            result.extend([(index, _topic) for _topic in index.get_topics(topic)])
164
173
        if not result:
165
 
            raise errors.NoHelpTopic(topic)
 
174
            raise NoHelpTopic(topic)
166
175
        else:
167
176
            return result