~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
    """Load bzrlib plugins.
273
273
 
274
274
    The environment variable BZR_PLUGIN_PATH is considered a delimited
275
 
    set of paths to look through. Each entry is searched for `*.py`
 
275
    set of paths to look through. Each entry is searched for *.py
276
276
    files (and whatever other extensions are used in the platform,
277
 
    such as `*.pyd`).
 
277
    such as *.pyd).
278
278
 
279
279
    load_from_path() provides the underlying mechanism and is called with
280
280
    the default directory list to provide the normal behaviour.
506
506
            result = self.module.__doc__
507
507
        if result[-1] != '\n':
508
508
            result += '\n'
509
 
        from bzrlib import help_topics
510
 
        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'
511
520
        return result
512
521
 
513
522
    def get_help_topic(self):
514
 
        """Return the module help topic: its basename."""
 
523
        """Return the modules help topic - its __name__ after bzrlib.plugins.."""
515
524
        return self.module.__name__[len('bzrlib.plugins.'):]
516
525
 
517
526