Skip to content

Commit 3b16880

Browse files
committed
sync
1 parent e1f51fd commit 3b16880

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fastcore/xdg.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,52 @@
77
# %% ../nbs/09_xdg.ipynb 3
88
from .utils import *
99

10-
# %% ../nbs/09_xdg.ipynb 6
10+
# %% ../nbs/09_xdg.ipynb 10
1111
def _path_from_env(variable, default):
1212
value = os.environ.get(variable)
1313
if value and os.path.isabs(value): return Path(value)
1414
return default
1515

16-
# %% ../nbs/09_xdg.ipynb 7
16+
# %% ../nbs/09_xdg.ipynb 11
1717
def _paths_from_env(variable, default):
1818
value = os.environ.get(variable)
1919
if value:
2020
paths = [Path(o) for o in value.split(":") if os.path.isabs(o)]
2121
if paths: return paths
2222
return default
2323

24-
# %% ../nbs/09_xdg.ipynb 10
24+
# %% ../nbs/09_xdg.ipynb 12
2525
def xdg_cache_home():
2626
"Path corresponding to `XDG_CACHE_HOME`"
2727
return _path_from_env("XDG_CACHE_HOME", Path.home()/".cache")
2828

29-
# %% ../nbs/09_xdg.ipynb 12
29+
# %% ../nbs/09_xdg.ipynb 15
3030
def xdg_config_dirs():
3131
"Paths corresponding to `XDG_CONFIG_DIRS`"
3232
return _paths_from_env("XDG_CONFIG_DIRS", [Path("/etc/xdg")])
3333

34-
# %% ../nbs/09_xdg.ipynb 14
34+
# %% ../nbs/09_xdg.ipynb 17
3535
def xdg_config_home():
3636
"Path corresponding to `XDG_CONFIG_HOME`"
3737
return _path_from_env("XDG_CONFIG_HOME", Path.home()/".config")
3838

39-
# %% ../nbs/09_xdg.ipynb 16
39+
# %% ../nbs/09_xdg.ipynb 19
4040
def xdg_data_dirs():
4141
"Paths corresponding to XDG_DATA_DIRS`"
4242
return _paths_from_env( "XDG_DATA_DIRS", [Path(o) for o in "/usr/local/share/:/usr/share/".split(":")])
4343

44-
# %% ../nbs/09_xdg.ipynb 18
44+
# %% ../nbs/09_xdg.ipynb 21
4545
def xdg_data_home():
4646
"Path corresponding to `XDG_DATA_HOME`"
4747
return _path_from_env("XDG_DATA_HOME", Path.home()/".local"/"share")
4848

49-
# %% ../nbs/09_xdg.ipynb 20
49+
# %% ../nbs/09_xdg.ipynb 23
5050
def xdg_runtime_dir():
5151
"Path corresponding to `XDG_RUNTIME_DIR`"
5252
value = os.getenv("XDG_RUNTIME_DIR")
5353
return Path(value) if value and os.path.isabs(value) else None
5454

55-
# %% ../nbs/09_xdg.ipynb 22
55+
# %% ../nbs/09_xdg.ipynb 25
5656
def xdg_state_home():
5757
"Path corresponding to `XDG_STATE_HOME`"
5858
return _path_from_env("XDG_STATE_HOME", Path.home()/".local"/"state")

0 commit comments

Comments
 (0)