mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 08:04:26 -04:00
replace os.access with os.path.isdir
This commit is contained in:
parent
a5d99b87b9
commit
70926f1d9f
1 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ class SnapshotView(View):
|
||||||
and embed_path
|
and embed_path
|
||||||
and os.access(abs_path, os.R_OK)
|
and os.access(abs_path, os.R_OK)
|
||||||
and abs_path.exists()):
|
and abs_path.exists()):
|
||||||
if abs_path.is_dir() and not any(abs_path.glob('*.*')):
|
if os.path.isdir(abs_path) and not any(abs_path.glob('*.*')):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
result_info = {
|
result_info = {
|
||||||
|
@ -102,7 +102,7 @@ class SnapshotView(View):
|
||||||
|
|
||||||
# iterate through all the files in the snapshot dir and add the biggest ones to1 the result list
|
# iterate through all the files in the snapshot dir and add the biggest ones to1 the result list
|
||||||
snap_dir = Path(snapshot.link_dir)
|
snap_dir = Path(snapshot.link_dir)
|
||||||
assert os.access(snap_dir, os.R_OK) and os.access(snap_dir, os.X_OK)
|
assert os.path.isdir(snap_dir) and os.access(snap_dir, os.R_OK)
|
||||||
|
|
||||||
for result_file in (*snap_dir.glob('*'), *snap_dir.glob('*/*')):
|
for result_file in (*snap_dir.glob('*'), *snap_dir.glob('*/*')):
|
||||||
extension = result_file.suffix.lstrip('.').lower()
|
extension = result_file.suffix.lstrip('.').lower()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue