/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 breezy/bedding.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-24 00:42:36 UTC
  • mto: This revision was merged to the branch mainline in revision 7505.
  • Revision ID: jelmer@jelmer.uk-20200524004236-jdj6obo4k5lznqw2
Cleanup Windows functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
    TODO: Global option --config-dir to override this.
65
65
    """
66
 
    base = osutils.path_from_environ('BZR_HOME')
 
66
    base = os.environ.get('BZR_HOME')
67
67
    if sys.platform == 'win32':
68
68
        if base is None:
69
69
            base = win32utils.get_appdata_location()
71
71
            base = win32utils.get_home_location()
72
72
        return osutils.pathjoin(base, 'bazaar', '2.0')
73
73
    if base is None:
74
 
        xdg_dir = osutils.path_from_environ('XDG_CONFIG_HOME')
 
74
        xdg_dir = os.environ.get('XDG_CONFIG_HOME')
75
75
        if xdg_dir is None:
76
76
            xdg_dir = osutils.pathjoin(osutils._get_home_dir(), ".config")
77
77
        xdg_dir = osutils.pathjoin(xdg_dir, 'bazaar')
91
91
    the bazaar one (see bazaar_config_dir()) does, use that instead.
92
92
    """
93
93
    # TODO: Global option --config-dir to override this.
94
 
    base = osutils.path_from_environ('BRZ_HOME')
 
94
    base = os.environ.get('BRZ_HOME')
95
95
    if sys.platform == 'win32':
96
96
        if base is None:
97
97
            base = win32utils.get_appdata_location()
98
98
        if base is None:
99
99
            base = win32utils.get_home_location()
100
100
    if base is None:
101
 
        base = osutils.path_from_environ('XDG_CONFIG_HOME')
 
101
        base = os.environ.get('XDG_CONFIG_HOME')
102
102
        if base is None:
103
103
            base = osutils.pathjoin(osutils._get_home_dir(), ".config")
104
104
    breezy_dir = osutils.pathjoin(base, 'breezy')
166
166
 
167
167
def cache_dir():
168
168
    """Return the cache directory to use."""
169
 
    base = osutils.path_from_environ('BRZ_HOME')
 
169
    base = os.environ.get('BRZ_HOME')
170
170
    if sys.platform in "win32":
171
171
        if base is None:
172
172
            base = win32utils.get_local_appdata_location()
173
173
        if base is None:
174
174
            base = win32utils.get_home_location()
175
175
    else:
176
 
        base = osutils.path_from_environ('XDG_CACHE_HOME')
 
176
        base = os.environ.get('XDG_CACHE_HOME')
177
177
        if base is None:
178
178
            base = osutils.pathjoin(osutils._get_home_dir(), ".cache")
179
179