From c4d3134f25caa50dbf8aac3aca2c08eed2c4ea36 Mon Sep 17 00:00:00 2001 From: Amged Wageh Date: Sat, 21 Dec 2024 00:41:12 +0300 Subject: [PATCH] Handling the absence of `db-shm` and `db-wal` files. Resolves: #43 --- drivefs_sleuth/utils.py | 14 ++++++++------ setup.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivefs_sleuth/utils.py b/drivefs_sleuth/utils.py index 42f8e17..6f32ce5 100644 --- a/drivefs_sleuth/utils.py +++ b/drivefs_sleuth/utils.py @@ -258,9 +258,10 @@ def get_content_caches_paths(content_cache_dir): for root, _, content_caches in os.walk(content_cache_dir): for content_cache in content_caches: content_caches_paths[content_cache] = os.path.abspath(os.path.join(root, content_cache)) - del (content_caches_paths['chunks.db']) - del (content_caches_paths['chunks.db-shm']) - del (content_caches_paths['chunks.db-wal']) + + content_caches_paths.pop('chunks.db', None) + content_caches_paths.pop('chunks.db-shm', None) + content_caches_paths.pop('chunks.db-wal', None) return content_caches_paths @@ -271,9 +272,10 @@ def get_thumbnails_paths(thumbnails_dir): for root, _, thumbnails in os.walk(thumbnails_dir): for thumbnail in thumbnails: thumbnails_paths[thumbnail] = os.path.abspath(os.path.join(root, thumbnail)) - del (thumbnails_paths['chunks.db']) - del (thumbnails_paths['chunks.db-shm']) - del (thumbnails_paths['chunks.db-wal']) + + thumbnails_paths.pop('chunks.db', None) + thumbnails_paths.pop('chunks.db-shm', None) + thumbnails_paths.pop('chunks.db-wal', None) return thumbnails_paths diff --git a/setup.py b/setup.py index 208d770..e81efcd 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='drivefs_sleuth', - version='1.2.0', + version='1.2.1', description='The ultimate Google Drive File Stream Investigator!', long_description=open('README.md', encoding='utf-8').read(), long_description_content_type='text/markdown',