mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Simplify permission check, GH-313
This commit is contained in:
parent
3ff92759fb
commit
7d6753042f
@ -29,9 +29,7 @@ pthj = os.path.join
|
|||||||
def is_dir_usable(pth):
|
def is_dir_usable(pth):
|
||||||
try:
|
try:
|
||||||
os.makedirs(pth,exist_ok=True)
|
os.makedirs(pth,exist_ok=True)
|
||||||
os.mknod(pthj(pth,".test"))
|
return os.access(pth,os.W_OK)
|
||||||
os.remove(pthj(pth,".test"))
|
|
||||||
return True
|
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -322,6 +320,7 @@ for identifier,path in data_directories.items():
|
|||||||
else:
|
else:
|
||||||
print("Directory",path,"is not usable.")
|
print("Directory",path,"is not usable.")
|
||||||
print("Please change permissions or settings!")
|
print("Please change permissions or settings!")
|
||||||
|
print("Make sure Maloja has write and execute access to this directory.")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user