~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: Aaron Bentley
  • Date: 2008-11-15 19:41:37 UTC
  • mto: This revision was merged to the branch mainline in revision 3841.
  • Revision ID: aaron@aaronbentley.com-20081115194137-wghezl9da7aluk3p
Add tests for plugins

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
    """Determine a plugin path suitable for general use."""
97
97
    path = os.environ.get('BZR_PLUGIN_PATH',
98
98
                          get_default_plugin_path()).split(os.pathsep)
 
99
    # Get rid of trailing slashes, since Python can't handle them when
 
100
    # it tries to import modules.
 
101
    path = map(_strip_trailing_sep, path)
99
102
    bzr_exe = bool(getattr(sys, 'frozen', None))
100
103
    if bzr_exe:    # expand path for bzr.exe
101
104
        # We need to use relative path to system-wide plugin
110
113
        # so relative path is ../../../plugins
111
114
        path.append(osutils.abspath(osutils.pathjoin(
112
115
            osutils.dirname(__file__), '../../../plugins')))
113
 
    # Get rid of trailing slashes, since Python can't handle them when
114
 
    # it tries to import modules.
115
 
    path = map(_strip_trailing_sep, path)
116
116
    if not bzr_exe:     # don't look inside library.zip
117
117
        # search the plugin path before the bzrlib installed dir
118
118
        path.append(os.path.dirname(_mod_plugins.__file__))