X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=reload_db.py;h=ff1c3a697386c344c1a94937714ffd05d11fa93b;hb=d6edab4a0f2b32288b355269da94813007c6ba00;hp=ee51b392aedb6048c6cf4dada016ae7cb7f930dd;hpb=161060b2c24bd37d7cd11f74297790dbe93504be;p=xsetbg.git diff --git a/reload_db.py b/reload_db.py index ee51b39..ff1c3a6 100755 --- a/reload_db.py +++ b/reload_db.py @@ -5,10 +5,6 @@ This file is a part of XSetBg. """ -__author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2007-2015 PhiloSoft Design" -__license__ = "GNU GPL" - import sys from sqlobject import SQLObjectNotFound from sqlobject.sqlbuilder import Insert @@ -24,7 +20,7 @@ def convert_str(s): fs_encoding = xsetbg_conf.get("images", "fs_encoding") -dump_file = open(sys.argv[1], 'rU') +dump_file = open(sys.argv[1], 'r') xsetbg_db = recreate_db() count_new = count_old = 0 @@ -46,7 +42,8 @@ with SQLiteMassInsert() as txn: count_new += 1 else: assert id is None or row.id == id - assert row.last_shown == timestamp + if row.last_shown is not None: + assert row.last_shown == timestamp count_old += 1 dump_file.close()