]> git.phdru.name Git - xsetbg.git/blob - dump_db.py
Version 5.0.2
[xsetbg.git] / dump_db.py
1 #! /usr/bin/env python
2 """Dump the DB sorted by date
3
4 This file is a part of XSetBg.
5
6 """
7
8 __author__ = "Oleg Broytman <phd@phdru.name>"
9 __copyright__ = "Copyright (C) 2006-2015 PhiloSoft Design"
10 __license__ = "GNU GPL"
11
12 import sys
13 from m_lib.defenc import default_encoding
14 from xsetbg_db import xsetbg_db
15
16 if not xsetbg_db:
17     sys.exit("Error: no database found")
18
19 for row in xsetbg_db.select(orderBy='-last_shown'):
20     print row.id, row.last_shown, row.full_name.encode(default_encoding)