mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Fix permissions after copying initial local files
This commit is contained in:
parent
c571ffbf07
commit
e060241acb
@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import stat
|
||||||
|
|
||||||
from importlib import resources
|
from importlib import resources
|
||||||
from pathlib import PosixPath
|
from pathlib import PosixPath
|
||||||
@ -34,6 +35,12 @@ def copy_initial_local_files():
|
|||||||
dst = PosixPath(dir_settings[cat]) / subfolder
|
dst = PosixPath(dir_settings[cat]) / subfolder
|
||||||
if os.path.isdir(src):
|
if os.path.isdir(src):
|
||||||
shutil.copytree(src, dst, dirs_exist_ok=True)
|
shutil.copytree(src, dst, dirs_exist_ok=True)
|
||||||
|
# fix permissions (u+w)
|
||||||
|
for dirpath, _, filenames in os.walk(dst):
|
||||||
|
os.chmod(dirpath, os.stat(dirpath).st_mode | stat.S_IWUSR)
|
||||||
|
for filename in filenames:
|
||||||
|
filepath = os.path.join(dirpath, filename)
|
||||||
|
os.chmod(filepath, os.stat(filepath).st_mode | stat.S_IWUSR)
|
||||||
|
|
||||||
|
|
||||||
charset = list(range(10)) + list("abcdefghijklmnopqrstuvwxyz") + list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
charset = list(range(10)) + list("abcdefghijklmnopqrstuvwxyz") + list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user