Lines Matching +full:check +full:- +full:path
4 import os.path
30 raise # re-raise
40 _badprefix=f'..{os.path.sep}',
42 """Return a normalized, absolute-path copy of the given filename."""
44 return os.path.abspath(filename)
46 relroot = os.path.abspath(relroot)
51 _badprefix=f'..{os.path.sep}',
56 filename = os.path.normpath(filename)
61 if not os.path.isabs(filename):
62 filename = os.path.join(relroot, filename)
64 relpath = os.path.relpath(filename, relroot)
65 if os.path.join(relroot, relpath) != filename:
73 filenames = (os.path.abspath(v) for v in filenames)
75 relroot = os.path.abspath(relroot)
83 _badprefix=f'..{os.path.sep}',
85 """Return a consistent relative-path representation of the filename."""
88 filename = os.path.normpath(filename)
90 # Otherwise leave it as-is.
94 filename = os.path.relpath(filename)
98 relroot = os.path.abspath(relroot)
101 filename = os.path.relpath(filename, relroot)
128 # We only accommodate the single-"**" case.
139 relroot = os.path.abspath(relroot)
153 check, start = _get_check(filename, start, include, exclude)
154 yield filename, relfile, check, solo
159 # XXX Do we need to use glob.escape (a la commit 9355868458, GH-20994)?
169 def check(): function
173 return check, None
197 yield os.path.join(parent, name)
244 If "root" is a non-string iterable then do the same for each of
251 filename as a relative path.
281 filename = os.path.relpath(filename, relparent)
303 # XXX posix-only?
310 def is_readable(file, *, user=None, check=False): argument
312 if check:
323 def is_writable(file, *, user=None, check=False): argument
325 if check:
336 def is_executable(file, *, user=None, check=False): argument
338 if check:
358 elif hasattr(file, 'name') and os.path.exists(file.name):
366 def _check_file(filename, check): argument
368 raise Exception(f'filename required to check file, got {filename}')
369 if check & S_IRANY:
371 elif check & S_IWANY:
373 elif check & S_IXANY:
377 raise NotImplementedError(check)
414 def _check_mode(st, mode, check, user): argument
415 orig = check
417 if check & S_IRANY:
418 check -= S_IRANY
430 if check & S_IWANY:
431 check -= S_IWANY
443 if check & S_IXANY:
444 check -= S_IXANY
456 if check:
457 raise NotImplementedError((orig, check))