- timestamp, filename = line.strip().split(None, 1)
- global_db[filename] = float(timestamp)
-global_db.close()
+ id, timestamp, filename = line.strip().split(None, 2)
+ id = convert_str(id)
+ timestamp = convert_str(timestamp)
+ if fs_encoding != 'utf-8':
+ filename = filename.decode(fs_encoding).encode('utf-8')
+ try:
+ row = xsetbg_db.byFull_name(filename)
+ except SQLObjectNotFound:
+ values = {'last_shown': timestamp, 'full_name': filename}
+ if id:
+ values['id'] = id
+ query = txn.sqlrepr(Insert(xsetbg_db.sqlmeta.table, values=values))
+ txn.query(query)
+ else:
+ assert id is None or row.id == id
+ assert row.last_shown == timestamp
+
+txn.commit()
+sqlhub.processConnection = connection
+