/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

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    """Get the DEFAULT_PLUGIN_PATH"""
58
58
    global DEFAULT_PLUGIN_PATH
59
59
    if DEFAULT_PLUGIN_PATH is None:
60
 
        DEFAULT_PLUGIN_PATH = osutils.pathjoin(config.config_dir(), 'plugins')
 
60
        path = [osutils.pathjoin(config.config_dir(), 'plugins')]
 
61
        if getattr(sys, 'frozen', None):    # bzr.exe
 
62
            # We need to use relative path to system-wide plugin
 
63
            # directory because bzrlib from standalone bzr.exe
 
64
            # could be imported by another standalone program
 
65
            # (e.g. bzr-config; or TortoiseBzr/Olive if/when they
 
66
            # will become standalone exe). [bialix 20071123]
 
67
            # __file__ typically is
 
68
            # C:\Program Files\Bazaar\lib\library.zip\bzrlib\plugin.pyc
 
69
            # then plugins directory is
 
70
            # C:\Program Files\Bazaar\plugins
 
71
            # so relative path is ../../../plugins
 
72
            path.append(osutils.abspath(osutils.pathjoin(
 
73
                osutils.dirname(__file__), '../../../plugins')))
 
74
        DEFAULT_PLUGIN_PATH = os.pathsep.join(path)
61
75
    return DEFAULT_PLUGIN_PATH
62
76
 
63
77
 
77
91
    global _loaded
78
92
    _loaded = True
79
93
 
 
94
 
80
95
def _strip_trailing_sep(path):
81
96
    return path.rstrip("\\/")
82
97
 
 
98
 
83
99
def set_plugins_path():
84
100
    """Set the path for plugins to be loaded from."""
85
101
    path = os.environ.get('BZR_PLUGIN_PATH',
141
157
        else:
142
158
            # it might be a zip: try loading from the zip.
143
159
            load_from_zip(d)
144
 
            continue
145
160
 
146
161
 
147
162
# backwards compatability: load_from_dirs was the old name