~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
    if not bzr_exe:     # don't look inside library.zip
101
101
        # search the plugin path before the bzrlib installed dir
102
102
        path.append(os.path.dirname(_mod_plugins.__file__))
 
103
    # search the arch independent path if we can determine that and
 
104
    # the plugin is found nowhere else
 
105
    if sys.platform != 'win32':
 
106
        try:
 
107
            from distutils.sysconfig import get_python_lib
 
108
        except ImportError:
 
109
            # If distutuils is not available, we just won't add that path
 
110
            pass
 
111
        else:
 
112
            archless_path = osutils.pathjoin(get_python_lib(), 'bzrlib',
 
113
                    'plugins')
 
114
            if archless_path not in path:
 
115
                path.append(archless_path)
103
116
    _mod_plugins.__path__ = path
104
117
    return path
105
118
 
407
420
        else:
408
421
            return None
409
422
 
 
423
    def load_plugin_tests(self, loader):
 
424
        """Return the adapted plugin's test suite.
 
425
 
 
426
        :param loader: The custom loader that should be used to load additional
 
427
            tests.
 
428
 
 
429
        """
 
430
        if getattr(self.module, 'load_tests', None) is not None:
 
431
            return loader.loadTestsFromModule(self.module)
 
432
        else:
 
433
            return None
 
434
 
410
435
    def version_info(self):
411
436
        """Return the plugin's version_tuple or None if unknown."""
412
437
        version_info = getattr(self.module, 'version_info', None)
413
438
        if version_info is not None and len(version_info) == 3:
414
439
            version_info = tuple(version_info) + ('final', 0)
415
440
        return version_info
416
 
    
 
441
 
417
442
    def _get__version__(self):
418
443
        version_info = self.version_info()
419
444
        if version_info is None: