This commit is contained in:
Reid 'arrdem' McKenzie 2022-08-12 23:26:56 -06:00
parent a484137be2
commit 66d90b1d44

View file

@ -19,13 +19,13 @@ Inspired by https://github.com/herval/org_photos/blob/main/org_photos.rb
import argparse import argparse
from datetime import datetime, timedelta from datetime import datetime, timedelta
from hashlib import sha256, sha512 from hashlib import sha256, sha512
import os
from pathlib import Path from pathlib import Path
import re import re
from shutil import copy2 as copyfile from shutil import copy2 as copyfile
import stat import stat
import sys import sys
import typing as t import typing as t
import os
from .util import * from .util import *
@ -351,7 +351,7 @@ def img_info(p: Path) -> ImgInfo:
def is_readonly(src: Path) -> bool: def is_readonly(src: Path) -> bool:
statinfo = os.stat(src, dir_fd=None, follow_symlinks=True) statinfo = os.stat(src, dir_fd=None, follow_symlinks=True)
if getattr(statinfo, 'st_flags', 0) & stat.UF_IMMUTABLE: if getattr(statinfo, "st_flags", 0) & stat.UF_IMMUTABLE:
return True return True
return False return False