~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: Aaron Bentley
  • Date: 2005-09-12 13:48:32 UTC
  • mfrom: (1185.3.4)
  • mto: (1185.1.16)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: abentley@panoramicfeedback.com-20050912134832-c23db11dc63170b6
Merged from mpool

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    
60
60
    from bzrlib.trace import log_error, mutter, log_exception
61
61
    from bzrlib.errors import BzrError
 
62
    from bzrlib import plugins
62
63
 
63
 
    bzrpath = os.environ.get('BZR_PLUGIN_PATH', DEFAULT_PLUGIN_PATH)
 
64
    dirs = os.environ.get('BZR_PLUGIN_PATH', DEFAULT_PLUGIN_PATH).split(":")
 
65
    dirs.insert(0, os.path.dirname(plugins.__file__))
64
66
 
65
67
    # The problem with imp.get_suffixes() is that it doesn't include
66
68
    # .pyo which is technically valid
70
72
    suffixes = imp.get_suffixes()
71
73
    suffixes.append(('.pyo', 'rb', imp.PY_COMPILED))
72
74
    package_entries = ['__init__.py', '__init__.pyc', '__init__.pyo']
73
 
    for d in bzrpath.split(os.pathsep):
 
75
    for d in dirs:
74
76
        # going through them one by one allows different plugins with the same
75
77
        # filename in different directories in the path
76
78
        mutter('looking for plugins in %s' % d)
114
116
                finally:
115
117
                    if plugin_info[0] is not None:
116
118
                        plugin_info[0].close()
117
 
            except Exception, e:
 
119
 
 
120
                mutter('loaded succesfully')
 
121
            except:
118
122
                log_error('Unable to load plugin %r from %r' % (name, d))
119
 
                log_error(str(e))
120
123
                log_exception()
121
124