From: Oleg Broytman Date: Fri, 24 Mar 2006 23:16:07 +0000 (+0000) Subject: Purge timestamp at the start. X-Git-Tag: v4.0.0~57 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=53236107c801e70aa51052b77f6c47dc6e2c1045;p=xsetbg.git Purge timestamp at the start. git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@11 143022c7-580b-0410-bae3-87f2bf5d3141 --- diff --git a/xsetbg.py b/xsetbg.py index 4721966..bca8f45 100755 --- a/xsetbg.py +++ b/xsetbg.py @@ -108,6 +108,12 @@ os.umask(0066) # octal; -rw-------; make the global persistent dictionary 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 @@ -127,7 +133,7 @@ except anydbm.error, msg: # 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) @@ -138,12 +144,6 @@ for key in to_delete: 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: