mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
also consider TMPDIR and friends
This commit is contained in:
parent
ece08b8179
commit
0db1244d04
|
@ -29,12 +29,16 @@ def get_unixdir():
|
||||||
paths = [
|
paths = [
|
||||||
(os.environ.get, "XDG_CONFIG_HOME"),
|
(os.environ.get, "XDG_CONFIG_HOME"),
|
||||||
(os.path.expanduser, "~/.config"),
|
(os.path.expanduser, "~/.config"),
|
||||||
|
(os.environ.get, "TMPDIR"),
|
||||||
|
(os.environ.get, "TEMP"),
|
||||||
|
(os.environ.get, "TMP"),
|
||||||
(unicode, "/tmp"),
|
(unicode, "/tmp"),
|
||||||
]
|
]
|
||||||
for chk in [os.listdir, os.mkdir]:
|
for chk in [os.listdir, os.mkdir]:
|
||||||
for pf, pa in paths:
|
for pf, pa in paths:
|
||||||
try:
|
try:
|
||||||
p = pf(pa)
|
p = pf(pa)
|
||||||
|
# print(chk.__name__, p, pa)
|
||||||
if not p or p.startswith("~"):
|
if not p or p.startswith("~"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue