/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 bzrlib/plugin.py

  • Committer: Blake Winton
  • Date: 2007-08-09 17:16:51 UTC
  • mto: (2753.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2754.
  • Revision ID: bwinton@latte.ca-20070809171651-r63ke3oe42cm6xtw
Add a note explaining why I strip the slashes twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
def set_plugins_path():
86
86
    """Set the path for plugins to be loaded from."""
87
87
    path = os.environ.get('BZR_PLUGIN_PATH',
88
 
                          get_default_plugin_path()).split(os.pathsep)
 
88
                          get_default_plugin_path()).split(os.pathsep)
 
89
    # Get rid of trailing slashes, since Python can't handle them when
 
90
    # it tries to import modules.
89
91
    path = map(strip_trailing_sep, path)
90
92
    # search the plugin path before the bzrlib installed dir
91
93
    path.append(os.path.dirname(plugins.__file__))
125
127
    for future reference.
126
128
 
127
129
    The python module path for bzrlib.plugins will be modified to be 'dirs'.
128
 
    """
 
130
    """
 
131
    # We need to strip the trailing separators here as well as in the
 
132
    # set_plugins_path function because calling code can pass anything in to
 
133
    # this function, and since it sets plugins.__path__, it should set it to
 
134
    # something that will be valid for Python to use (in case people try to
 
135
    # run "import bzrlib.plugins.PLUGINNAME" after calling this function).
129
136
    plugins.__path__ = map(strip_trailing_sep, dirs)
130
137
    for d in dirs:
131
138
        if not d: