mirror of
https://github.com/krateng/maloja.git
synced 2025-04-15 16:30:32 +03: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):
|
||||
try:
|
||||
os.makedirs(pth,exist_ok=True)
|
||||
os.mknod(pthj(pth,".test"))
|
||||
os.remove(pthj(pth,".test"))
|
||||
return True
|
||||
return os.access(pth,os.W_OK)
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
@ -322,6 +320,7 @@ for identifier,path in data_directories.items():
|
||||
else:
|
||||
print("Directory",path,"is not usable.")
|
||||
print("Please change permissions or settings!")
|
||||
print("Make sure Maloja has write and execute access to this directory.")
|
||||
raise
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user