import os
import sys
+from sqlobject.sqlbuilder import LIKE
+
from xsetbg_db import xsetbg_db
if not xsetbg_db:
from_filename = os.path.abspath(from_filename)
to_filename = os.path.abspath(to_filename)
+connection = xsetbg_db._connection
+txn = connection.transaction()
+xsetbg_db._connection = txn
+
rows = list(xsetbg_db.selectBy(full_name=from_filename))
if not rows:
sys.exit("No rows by filename %s" % from_filename)
row = rows[0]
row.full_name = to_filename
+
os.rename(from_filename, to_filename)
+txn.commit()