~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    errors,
49
49
    trace,
50
50
    )
51
 
from bzrlib.i18n import gettext
52
51
from bzrlib import plugins as _mod_plugins
53
52
""")
54
53
 
138
137
        try:
139
138
            name, path = spec.split('@')
140
139
        except ValueError:
141
 
            raise errors.BzrCommandError(gettext(
142
 
                '"%s" is not a valid <plugin_name>@<plugin_path> description ')
 
140
            raise errors.BzrCommandError(
 
141
                '"%s" is not a valid <plugin_name>@<plugin_path> description '
143
142
                % spec)
144
143
        specs.append((name, path))
145
144
    return specs
507
506
            result = self.module.__doc__
508
507
        if result[-1] != '\n':
509
508
            result += '\n'
510
 
        from bzrlib import help_topics
511
 
        result += help_topics._format_see_also(additional_see_also)
 
509
        # there is code duplicated here and in bzrlib/help_topic.py's
 
510
        # matching Topic code. This should probably be factored in
 
511
        # to a helper function and a common base class.
 
512
        if additional_see_also is not None:
 
513
            see_also = sorted(set(additional_see_also))
 
514
        else:
 
515
            see_also = None
 
516
        if see_also:
 
517
            result += 'See also: '
 
518
            result += ', '.join(see_also)
 
519
            result += '\n'
512
520
        return result
513
521
 
514
522
    def get_help_topic(self):
515
 
        """Return the module help topic: its basename."""
 
523
        """Return the modules help topic - its __name__ after bzrlib.plugins.."""
516
524
        return self.module.__name__[len('bzrlib.plugins.'):]
517
525
 
518
526