]> git.phdru.name Git - xsetbg.git/commitdiff
Fix a bug: id can be None
authorOleg Broytman <phd@phdru.name>
Thu, 23 Jul 2015 21:55:34 +0000 (00:55 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 23 Jul 2015 21:55:34 +0000 (00:55 +0300)
reload_db.py

index 93eeac9fd82f40af6e0259161c649f2a1ee32211..64e84f4cdafbc8b21ec6e8c0b370df9c7d812f5a 100755 (executable)
@@ -19,6 +19,7 @@ fs_encoding = xsetbg_conf.get("images", "fs_encoding")
 dump_file = open(sys.argv[1], 'rU')
 xsetbg_db = recreate_db()
 
+
 def convert_str(s):
     if s == "None":
         return None
@@ -50,7 +51,7 @@ for line in dump_file:
         query = txn.sqlrepr(Insert(xsetbg_db.sqlmeta.table, values=values))
         txn.query(query)
     else:
-        assert row.id == id
+        assert id is None or row.id == id
         assert row.last_shown == timestamp
 
 txn.commit()