X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=dump_db.py;h=ca3c6a74be70213190721f1940f564607e9eb79a;hb=8d05302c387169fa41f23b293c404bd3cb6561d6;hp=470ff0a06c9120de7ad72667ac0bc18017ba9a22;hpb=577e6f1ca8e079172fcd42f373f5948e84d3d0b6;p=xsetbg.git diff --git a/dump_db.py b/dump_db.py index 470ff0a..ca3c6a7 100755 --- a/dump_db.py +++ b/dump_db.py @@ -6,11 +6,15 @@ This file is a part of XSetBg. """ import sys -from m_lib.defenc import default_encoding +from xsetbg_conf import xsetbg_conf from xsetbg_db import xsetbg_db if not xsetbg_db: sys.exit("Error: no database found") +fs_encoding = xsetbg_conf.get("images", "fs_encoding") for row in xsetbg_db.select(orderBy='-last_shown'): - print(row.id, row.last_shown, row.full_name.encode(default_encoding)) + sys.stdout.buffer.write( + ('%d %s %s\n' % (row.id, row.last_shown, row.full_name + )).encode(fs_encoding) + )