From 807ba6a14b26938e70d59a2e7a1f67d31be9598c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 9 Jul 2013 01:03:44 +0000 Subject: [PATCH] Get filesystem encoding from config git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@60 143022c7-580b-0410-bae3-87f2bf5d3141 --- print-filename.py | 9 +++++++-- xsetbg.conf | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/print-filename.py b/print-filename.py index 0c8e8f9..6d14255 100755 --- a/print-filename.py +++ b/print-filename.py @@ -62,7 +62,12 @@ else: filename = global_db[key] global_db.close() -from m_lib.defenc import default_encoding -filename = unicode(filename, default_encoding) +from ConfigParser import SafeConfigParser +config = SafeConfigParser() +config.read("xsetbg.conf") + +fs_encoding = config.get("images", "fs_encoding") +filename = unicode(filename, fs_encoding) +from m_lib.defenc import default_encoding print filename.encode(default_encoding) diff --git a/xsetbg.conf b/xsetbg.conf index cda0176..3dd1bf5 100644 --- a/xsetbg.conf +++ b/xsetbg.conf @@ -1,4 +1,5 @@ [images] +fs_encoding = koi8-r directory0 = ~/lib/xsetbg/images [httpd] -- 2.39.5