summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bc04f70)
It's really a simpler version of dump_db.py.
"""
__author__ = "Oleg Broytman <phd@phdru.name>"
"""
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2006-2014 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2006-2015 PhiloSoft Design"
-from operator import itemgetter
+import sys
+from m_lib.defenc import default_encoding
from xsetbg_db import xsetbg_db
from xsetbg_db import xsetbg_db
-for key, value in sorted(xsetbg_db.items(), key=itemgetter(1), reverse=1):
- if key.startswith('/'):
- print key
-xsetbg_db.close()
+if not xsetbg_db:
+ sys.exit("Error: no database found")
+
+for row in xsetbg_db.select('last_shown IS NOT NULL', orderBy='-last_shown'):
+ print row.full_name.encode(default_encoding)