global_db_name = "xsetbg.db"
+# DB keys
+timestamp_key = "timestamp"
+filename_key = "filename"
+old_filename_key = "old_filename"
+
+
import random
import anydbm, shelve
from time import time
# Remove old filenames
old_time = time() - min_delay
-to_delete = []
+to_delete = [timestamp_key]
for key in global_db.keys():
if key.startswith('/') and global_db[key] < old_time:
to_delete.append(key)
global_db.close() # Close DB in the parent process
-# DB keys
-timestamp_key = "timestamp"
-filename_key = "filename"
-old_filename_key = "old_filename"
-
-
images = []
for image_dir in image_dirs: